Re: Xcode3.2 build and analyze warning for NSString allocation
Re: Xcode3.2 build and analyze warning for NSString allocation
- Subject: Re: Xcode3.2 build and analyze warning for NSString allocation
- From: Jeremy Pereira <email@hidden>
- Date: Sun, 27 Sep 2009 18:45:38 +0100
On 27 Sep 2009, at 10:03, Nick Rogers wrote:
Hi,
When I alloc and init a NSString the following way, there is warning
that:
Potential leak of an object allocated on line 526 and stored in
sizeDisp.
1. Method returns an Objective-C object with a +1 retain count
(owning reference).
2. Object returned to caller as an owning reference (single retain
count transferred to caller).
3. Object allocated on line 526 and stored into 'sizeDisp' is
returned from a method whose name
('tableView:objectValueForTableColumn:row:') does not contain 'copy'
or otherwise starts with 'new' or 'alloc'. This violates the naming
convention rules given in the Memory Management Guide for Cocoa
(object leaked).
Can I hope for a small analysis of the above from anybody?
It's hard to see how item 3 above can be improved on as an analysis
except by providing a link to the memory management guidelines. So
here they are.
http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html#//apple_ref/doc/uid/20000994
Thanks,
Nick
_______________________________________________
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
_______________________________________________
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