I'm trying to understand Objective-C properties and I have some lingering questions about their syntax.
What is the difference between explicitly declaring an ivar for a property like this:
@interface myObject1 : NSObject {
NSString *title;
}
@property (copy) NSString *title;
@end
and this:
@interface myObject2 : NSObject {
}
@property (copy) NSString *title;
@end
The myObject2 example seems to work. Is it OK to implement properties as in myObject2 or should the associated ivar always be explicitly defined?
What are the ramifications of not explicitly declaring the ivar?