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

Popular posts from this blog

php - Hide output during test execution -

javascript - Migrate custom AngularJS filter from 1.2.28 to 1.4.x -

Update Magento products with multiple images -