The line of code   [NSArray arrayWithObjects: c0, ...c9, nil];  produces
an array all right - but as you have used a class initializer, it will auto release
when you return from the method where it was created.
Any initialiser with a "+" in front of it returns an autoreleased object
- hence you MUST retain them or else they are simply released
when the autorelease pool they are created in is released - which you can treat
as occurring at the end of the method in which the init occurs.

Do it like this    [ [NSArray arrayWithObjects: c0, ...c9, nil] retain];

and then it will stay around until you send it a release message,
probably  in the dealloc method;

                [cityArray  release];

(PH)
_______________________________________________

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]

Reply via email to