Re: Problems with [NSArray count]
Re: Problems with [NSArray count]
- Subject: Re: Problems with [NSArray count]
- From: Andy Lee <email@hidden>
- Date: Tue, 22 Apr 2008 17:19:55 -0400
On Apr 22, 2008, at 5:03 PM, Peter Browne wrote:
The docs tell me that [NSArray count] returns an NSUInteger, but
exactly WHAT one of these is, or how I use it is baffling me.
You could do a search using the built-in documentation browser in
Xcode (it's in the Help menu). Alternatively, Google would seem an
obvious thing to try -- it turns up a number of relevant documents.
int i = [myArray count];
crashes out, and I've tried various other types of variable to no
avail. Any thoughts? Am I missing something blindingly obvious here?
My first guess would be that myArray was not properly retained and was
deallocated before you sent the count message. You may want to review
the memory management rules, especially if you're quite rusty: <http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html
>.
Also, are you sure that's the line you're crashing on? Do any error
messages get written to the console?
--Andy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden