> On Aug 15, 2015, at 1:14 PM, Mike Abdullah <[email protected]> wrote:
> 
> NSArray *array = [hostObject myArray];
> // run your checks, etc.
> NSString *someString = [array objectAtIndex:2];

Just to be safe:

NSArray *array = [[hostObject myArray] retain];
// run your checks, etc.
NSString *someString = [array objectAtIndex:2];
[array release];

Or whatever other way of ensuring the array isn’t dealloced out from under you, 
depending on how you’re doing memory management
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to