What does a variable in the interface without a property means, like below?
@interface SubObject : BaseObject{
NSString *name;
}
@end
What is the significance and usage of this variable?
What does a variable in the interface without a property means, like below?
@interface SubObject : BaseObject{
NSString *name;
}
@end
What is the significance and usage of this variable?
This is known as a ivar
or Instance Variable
and has default access rights.
fantastic accepted answer on Reason to use ivars vs properties in objective c
I have also given an to The Field between Objective-c and Java, and I don't understand the @property and instance variable which may help
By declaring variable like this mean you are declaring an string which is accessible in all methods in your.m class, but it will not accessible in other class in your project. If you want this string in another class then make property
like this
@property(strong, nonatomic)NSString *string;