On Wed, Jan 20, 2010 at 2:37 PM, Gwynne Raskind <gwy...@darkrainfall.org> wrote:
> As usual, the blindingly obvious proves to be the problem. I had ensured 
> perfect KVC/KVO compliance, and I was using the compliant accessors 
> everywhere except for one place: the delegate's -awakeFromNib method where I 
> create the Player object in the first place. I declared the property 
> readwrite in the class extension and changed player = [[Player alloc] init] 
> to self.player = [[[Player alloc] init] autorelease], and suddenly it all 
> worked. (Though it vaguely annoys me that I have to add a spurious 
> retain/autorelease to the Player object.)

You don't technically have to. You could do:

[self willChangeValueForKey:@"player"];
player = [[Player alloc] init];
[self didChangeValueForKey:@"player"];

--Kyle Sluder
_______________________________________________

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 arch...@mail-archive.com

Reply via email to