Usually, when we have to link an interface element to a field of a class, we use the keyword IBOutlet to inform the pre-copiler:
@interface MyController : NSObject {
IBOutlet NSWindow *theWindow;
}
and in the implementation we use directly the pointer theWindow
to call methods of the class NSWindow!
But what are the advantages of tell to the pre-compiler to create some accessors to the object that is pointed by "theWindow" and manage the object through the accessors?
Example:
@interface MyController : NSObject {
NSWindow *theWindow;
}
@property(retain) IBOutlet NSWindow *theWindow;
@implementation MyController
@synthesize theWindow;
@end
Does the use of the second solution (for all the pointers to interface s elements) slows the performances of the application?
When is it a good practice to use the second way instead of the first?
Thank you!