ios - How to declare object variables for good code structure objective C -


i know question silly need know further development. developing iphone application programmatically without using xib , storyboard, have declared multiple object variables below

    uinavigationcontroller *navigationcontroller;     uiactivityindicatorview *activityindicator;     uiimageview *splashimage;     nstimer *checkjsontimer;     uilocalnotification *localnotification;     nsuserdefaults * defaults;  @property (strong, nonatomic) uiwindow *window; @property (strong, nonatomic) login *loginview; @end 

above code .h file had declared, question of uiobjects declared without @property , variable declaring properties , attributes also. objects ui , ns , how declare above 2 methods.

which 1 proper way of programming , too?.

you should read documentation.. short answer properties give getters , setters free. (but please read docs, there lot more , possible) when define @property don't have define variable anymore (in past had actually). want want use properties.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -