Is there any difference in where we define private instance variables? As I understand there are two possibilties:
1) In header file
@interface MyViewController : UIViewController {
@private
NSString *fooString;
}
2) Second way is to define it in the implementation:
@implementation MyViewController
NSString *fooString;
What is the difference? Cheers!
In 2nd case fooString is not instance variable - it is global variable, so your two cases are completely different
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With