• 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: NSString memory management question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString memory management question


  • Subject: Re: NSString memory management question
  • From: "Shawn Erickson" <email@hidden>
  • Date: Tue, 22 Apr 2008 15:51:52 -0700

On Tue, Apr 22, 2008 at 3:25 PM, Rick Mann <email@hidden> wrote:
> I wrote a routine that creates a CFStringRef from some USB calls. I use it
> like this:
>
>         NSString* s = (NSString*) createStringDescriptor(dev, stringIndex);
>         [mSerialNumberDisplay setStringValue: [s lowercaseString]];
>         [s release];
>
>
>  Two main questions: am I right to release the bridged NSString* s? and,

We don't know how you created the CFStringRef so we cannot say. The
answer depends on the create/get rule of the Core Foundation method
you used. Additionally it depends on the contract you want to present
to clients for the createStringDescriptor.

> what happens in -lowercaseString? How does that get released?

Review...

<http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html>

-Shawn
_______________________________________________

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

  • Follow-Ups:
    • Re: NSString memory management question
      • From: Rick Mann <email@hidden>
References: 
 >NSString memory management question (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: GUI Time Field
  • Next by Date: Re: NSString memory management question
  • Previous by thread: NSString memory management question
  • Next by thread: Re: NSString memory management question
  • Index(es):
    • Date
    • Thread