Convience Methods and Collections
- Subject: Convience Methods and Collections
- From: Ryan Marsh <email@hidden>
- Date: Fri, 30 Mar 2007 10:14:08 -0500
- Delivered-to: email@hidden
- Delivered-to: email@hidden
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=QN0g0dERQ3tutqzg76LN4jaeslN0eykhAePVjh7p6RQfBNBaS8QrOHmAo/HZAQ74mnxLr3F5A9aFlGMO+/cwHSkpVa2HN04JuSbxCz225KM0ZS8ht/mI4iWnhy+S2aXviofjHSGQwlS8W8Kw3qOQ32DR8VSuS2tCrOs3rlPCdb4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=ggrUin8Q29NZM7I4dHhmpze4AIgiEin7KX3sRYbf0umhszbxySUac7Ru4ifDpu4JSXAYrwRBVotQdUE4SW15tBU4OuMqZeCwPB4Agc7UAn4ax9ZCf/QBMpQazfMLzPM+clCIy2ZUkd3xbwzra/Y7tABAkAQp/muC4nhGk8Eaq0c=
Hello All,
I apologize in advance for such a newbie question.
Why do objects created with convenience methods get auto-released
when I add them to a collection?
This simple example from the init of an NSOutlineView datasource:
[rootNode setObject:[NSArray
arrayWithObjects:devices,folders,playlists,nil] forKey:@"children"];
The array will be released before the first time I call
[rootNode objectForKey:@"children"]
If I use [[NSArray alloc]
initWithObjects:devices,folders,playlists,nil] then it works fine.
Thanks,
-ryan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.