• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problems with [NSArray count]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Problems with [NSArray count] (From: Peter Browne <email@hidden>)

  • Prev by Date: Re: Problems with [NSArray count]
  • Next by Date: Re: NSTextfields and keyboard equivalents - am I missing something?
  • Previous by thread: Re: Problems with [NSArray count]
  • Next by thread: Saving NSTextView data to CoreData without ending editing
  • Index(es):
    • Date
    • Thread