| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| It should be 1 since you didn't alloc or manually retain kArr. -arrayWithObjects autoreleases the created array. This is true across the Cocoa framework: helper object creation methods always autorelease unless otherwise annotated in the docs. e.g.: [[NString alloc]init] ; // retains NSString *aString = [NSString stringWithString:@"test"] ; // does not retain (or, more correctly, retains and then autoreleases) [aString retain] ; // now it's retained NSString *aString = [NSString stringWithString:@"test"] ; // does not retain (or, more correctly, retains and then autoreleases) [anArray addObject:aString] ; // now it's retained Mike On Apr 18, 2008, at 10:58 AM, Optical Ali wrote:
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. Objc-language mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/objc-language/email@hidden This email sent to email@hidden
| References: | |
| >NSDictionary and retaining values (From: "Optical Ali" <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.