FROM : Andy Lee
DATE : Tue Apr 22 23:19:55 2008
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
DATE : Tue Apr 22 23:19:55 2008
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
| Related mails | Author | Date |
|---|---|---|
| Peter Browne | Apr 22, 23:03 | |
| Shawn Erickson | Apr 22, 23:10 | |
| Shawn Erickson | Apr 22, 23:14 | |
| David Duncan | Apr 22, 23:15 | |
| Andy Lee | Apr 22, 23:19 | |
| Peter Browne | Apr 22, 23:45 | |
| Hamish Allan | Apr 22, 23:57 | |
| Shawn Erickson | Apr 23, 00:04 | |
| David Duncan | Apr 23, 01:08 |






Cocoa mail archive

