3

Possible Duplicate:
Instance variables declared in ObjC implementation file

I would like to know the difference in terms of visibility between the following two code snippets, i.e. where and who can access/see the variable name and all other difference as well (other than one is category).

1:

// in implementation file SchoolTableViewController.m
@interface SchoolTableViewController()
{
NSString* name;
}

@end

@implementation SchoolTableViewController
...
@end

2:

// in implementation file SchoolTableViewController.m
@implementation SchoolTableViewController
{
NSString* name;
}
...
@end
Community
  • 1
  • 1
user1233587
  • 2,033
  • 4
  • 24
  • 24
  • See this [link](http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/objectivec/chapters/occategories.html) ,may be it will help you! – Sanoj Kashyap Sep 20 '12 at 07:24
  • This question is not the same as the link provided with reason of duplication. I voted to open this question. – user523234 Feb 19 '14 at 15:31

1 Answers1

0

I think second scenario of the variable has @protected scope, whereas in first case it's visibility is limited to only the .m file

Naresh
  • 1,336
  • 9
  • 14