Re: NSMutableArray becomes NSString?
Re: NSMutableArray becomes NSString?
- Subject: Re: NSMutableArray becomes NSString?
- From: "Shawn Erickson" <email@hidden>
- Date: Fri, 13 Apr 2007 08:02:26 -0700
On 4/13/07, Timothy Collett <email@hidden> wrote:
I am attempting to use an NSMutableArray, and while debugging, I can
observe it get initialized, and have 2 objects added to it...and
then, some time between there and when I need to access it (still
within the initialization phase of my program), it turns into an
NSString. The address appears to be the same, but the type has
inexplicably changed. I have gone through my program, checked every
occurrence of the variable in question, and every occurrence of
NSString (it's not yet a very large program), and I can see nowhere
that they even occur on the same line, let alone have the array cast
to a string...
Can anyone give some advice as to a) how this might have happened,
and/or b) how I might go about tracking down exactly where it happens?
Thanks very much...and apologies if this is some stupid n00b problem :-/
The cause is most likely an object lifetime management issue in your code.
If you see the same pointer value suddenly appear to point at a
different type of object that means the object originally at that
location got deallocated. That can happen if you don't follow the
Cocoa memory contract.
Review...
<http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/index.html>
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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