Re: NSString initWithUTF8String - crazy retainCount with empty string
Re: NSString initWithUTF8String - crazy retainCount with empty string
- Subject: Re: NSString initWithUTF8String - crazy retainCount with empty string
- From: "Simon Strandgaard" <email@hidden>
- Date: Sat, 24 Mar 2007 17:31:42 +0100
On 3/24/07, mmalc crawford <email@hidden> wrote:
On Mar 24, 2007, at 8:55 AM, Simon Strandgaard wrote:
> I am adding undo/redo to my program and want to make sure things
> can be released correctly by NSUndoManager some point in the future.
> So I assert on retainCount before passing the ownership to
> NSUndoManager.
>
Why?
As a relatively unexperienced mac developer, I wrongly assumed that
NSString initWithUTF8String would return an unique instance.
I still don't master referencecounting and thus believed that having
a check to ensure things were good would help me to detect when
I had screwed up refcounting. Long story.
> If retainCount isn't working, then I have no means to verify my
> resources is being released correctly.
>
Have you adhered to your side of the memory management contract?
I am trying. Thanks my problem was me :-)
--
Simon Strandgaard
http://opcoders.com/
_______________________________________________
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