• 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: How determine if file is in Trash, given Path or Alias
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How determine if file is in Trash, given Path or Alias


  • Subject: Re: How determine if file is in Trash, given Path or Alias
  • From: "Sean McBride" <email@hidden>
  • Date: Wed, 3 Jun 2009 10:13:59 -0400
  • Organization: Rogue Research Inc.

On 6/2/09 10:17 PM, Michael Ash said:

>>>The description of [NSString UTF8String] says
>>>that "the returned C string is automatically freed just as a returned
>>>object would be released", which implies (to me) that the returned
>>>pointer is to GC-controlled memory.
>>
>> Then shouldn't its return value be __strong?  (It's not.)
>
>Not really. __strong has no meaning when applied to function/method
>return values (or arguments or local variables). It doesn't break
>anything, but it also doesn't do anything. __strong only changes how
>things work when applied to heap memory, such as instance variables,
>or structs that you've malloced memory for.

I see.

>It would be sensible to use __strong as a decorator for non-object
>pointer return values to indicate that they are GC-allocated memory,
>purely out of convention, but as far as I know such a convention is
>not established in the API as of 10.5.

NSAllocateCollectable() for example returns "void *__strong"; UTF8String
and fileSystemRepresentation (and others) do not.  This discrepancy is
either  a) an indication that the returned memory may not be GC-
controlled  b) an error in the declarations.  I don't know for sure.

The docs sure could use some love in this area.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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: 
 >Re: How determine if file is in Trash, given Path or Alias (From: "Sean McBride" <email@hidden>)
 >Re: How determine if file is in Trash, given Path or Alias (From: Gwynne Raskind <email@hidden>)
 >Re: How determine if file is in Trash, given Path or Alias (From: Quincey Morris <email@hidden>)
 >Re: How determine if file is in Trash, given Path or Alias (From: "Sean McBride" <email@hidden>)
 >Re: How determine if file is in Trash, given Path or Alias (From: Michael Ash <email@hidden>)

  • Prev by Date: Re: Internationalizing Bundle Icon
  • Next by Date: Help on adding volume control
  • Previous by thread: Re: How determine if file is in Trash, given Path or Alias
  • Next by thread: Re: How determine if file is in Trash, given Path or Alias
  • Index(es):
    • Date
    • Thread