Re: Outlets / IBOutlet declarations (was Re: InterfaceBuilder &Wiring Objects)
On Nov 19, 2008, at 4:55 PM, Jeff Laing wrote: Well, that's sort of my point, really. I don't *know* what happens inside the *synthesized* code, the only thing I can do is look to Apple who do and what they've said in the past is "don't do it". Not "its not safe". So I don't think I can make my own mind up - Apple has made it up for me, without explicitly telling me what the decision was, only hinting at it. I think that's being overly defensive. Synthesized accessors will be straight forward and minimal. They're not the problem. The problem is fancy extra special stuff that we often add to manual accessors. j o a r ___ 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]
RE: Outlets / IBOutlet declarations (was Re: InterfaceBuilder &Wiring Objects)
> From: Roland King [mailto:[EMAIL PROTECTED] > I think if you're talking about your own instance variables which you > are declaring and synthesizing, you have enough information to decide > if it's safe to call your property accessors in dealloc or not. Well, that's sort of my point, really. I don't *know* what happens inside the *synthesized* code, the only thing I can do is look to Apple who do and what they've said in the past is "don't do it". Not "its not safe". So I don't think I can make my own mind up - Apple has made it up for me, without explicitly telling me what the decision was, only hinting at it. ___ 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]
Re: Outlets / IBOutlet declarations (was Re: InterfaceBuilder &Wiring Objects)
Jeff Laing wrote: There's no difference between setting through a property, and setting through a plain old setter method. That said, it's up to you to decide if you want to go with the official recommendation or not. If you think that you have enough control over the implementation of your accessor methods, you might choose to still use them. The question has been related to "best practices", which is why I'm pursuing it. As to 'control over the implementation of your accessors', if people use @synthesize (thus taking whatever the compiler gives them) and/or have bindings (or whatever it is) sneaking additional KVO/C stuff in over the top of their accessors, how much information do they actually *have* about their accessors to make an informed choice? I think if you're talking about your own instance variables which you are declaring and synthesizing, you have enough information to decide if it's safe to call your property accessors in dealloc or not. If you're inheriting a property from above .. well you shouldn't have to care about it as someone else is worrying about it in their dealloc. One case in which I use the setter in my dealloc code is is when I have a custom setter which does something, like it tears down KVO or turns off a timer or otherwise cleans up, I fix the setFoo: method to be the one place I do that work, and then I use [ bar setFoo:nil ] in the dealloc(). Given I do that, I think I should probably just use setBlah:nill for all my dealloc() needs for consistency as I like to have one way of doing things if possible. The only 'problem' with this I can see is that it triggers KVO if someone's observing me, but they shouldn't be, I'm being dealloc'ed and if someone's observing me and they've allowed me to be fully released, that's their bug. ___ 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]
RE: Outlets / IBOutlet declarations (was Re: InterfaceBuilder &Wiring Objects)
> There's no difference between setting through a property, and setting > through a plain old setter method. That said, it's up to you to decide > if you want to go with the official recommendation or not. If you > think that you have enough control over the implementation of your > accessor methods, you might choose to still use them. The question has been related to "best practices", which is why I'm pursuing it. As to 'control over the implementation of your accessors', if people use @synthesize (thus taking whatever the compiler gives them) and/or have bindings (or whatever it is) sneaking additional KVO/C stuff in over the top of their accessors, how much information do they actually *have* about their accessors to make an informed choice? ___ 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]