I simply don't need properties for all my Outlets, except for this
issue. I also don't really like making all my outlets implicitly
public. But I'm forced to do that.
Here's one way to avoid making your outlets public:
// Header
@interface MyClass : NSObject {
@private
IBOutlet UILabel *myLabel;
}
@end
// Implementation
@implementation MyClass
- (void)setMyLabel:(UILabel *)myLabel {
myLabel = label;
}
@end
You get non-retained outlets, and it's still explicit and obvious. You
can create many other variations of this. For example, you can use
@property and @synthesize in only the implementation file. The most
important thing to remember is that IB calls setValue:forKeyPath: with
a key path that is equal to the name of your outlet. You can read
about key value coding here: http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/KeyValueCoding.html
Compiled in mail -
Jon Hess
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]