• 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: Xcode3.2 build and analyze warning for NSString allocation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Xcode3.2 build and analyze warning for NSString allocation (From: Nick Rogers <email@hidden>)

  • Prev by Date: Re: where to release a CF object thats retained by a cocoa object
  • Next by Date: Re: Core Animation and Run Loops
  • Previous by thread: Re: Xcode3.2 build and analyze warning for NSString allocation
  • Next by thread: Snow Leopard, core data, read only and multiple threads
  • Index(es):
    • Date
    • Thread