ios - Difference between @property and variable within interface declaration -


this question has answer here:

what's difference between putting variable inside of @interface{} declaration in header file, , putting in @property after declaration?

e.g.,

@interface gamecentermanager : nsobject { gkinvite* pendinginvite; } @end 

as opposed to

@interface gamecentermanager : nsobject @property (weak, nonatomic) gkinvite* pendinginvite @end 

declaring property generates getters , setters instance variable, according criteria within parenthesis.

defining variables in brackets declares them instance variables.

following links provides more info on these.

http://www.cocoawithlove.com/2010/03/dynamic-ivars-solving-fragile-base.html

is there difference between "instance variable" , "property" in objective-c?

http://iphonedevelopment.blogspot.in/2008/12/outlets-property-vs-instance-variable.html


Comments

Popular posts from this blog

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

Android Gson.fromJson error -