Difference in variable declarations - objective c -
my question conceptual - difference between following 2 snippets of code?
1)
@implementation person { nsstring *name; // other variables } - (void) somemethod @end
2)
@implementation person nsstring *name; //other variables - (void) somemethod @end
the reason ask able compile code followed format #2 not format #1, , curious difference between two.
the first declares instance variable. name belongs person object.
the second declare global variable.
Comments
Post a Comment