• 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: NSOpenPanel problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOpenPanel problem


  • Subject: Re: NSOpenPanel problem
  • From: Ken Thomases <email@hidden>
  • Date: Mon, 23 Jan 2012 10:08:19 -0600

On Jan 23, 2012, at 9:16 AM, Jan E. Schotsman wrote:

> On Jan 23, 2012, at 11:37 AM, Conrad Shultz wrote:
>
>>> if I try to pass on someString in a C struct (contextInfo) then the
>>> compiler complains that ARC doesn't like object pointers in C structs.
>>> I could serialize and unserialize the string. Or is there a better way?
>>
>> Just use the NSString * right in the block - no need for structs,
>> serialization, or anything.  That's why blocks are so useful.
>
>
> I still need an alternative because I want to support Leopard where blocks aren't available. I've written some code using NSPropertyListSerialization which should do the trick.

If you're supporting Leopard, then you can't use ARC and the original problem goes away.  Also, serializing a string doesn't help because you still have a Cocoa object -- an NSData now instead of an NSString -- and you have to manage its memory just the same.

Regards,
Ken


_______________________________________________

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: NSOpenPanel problem
      • From: "Jan E. Schotsman" <email@hidden>
References: 
 >NSOpenPanel problem (From: "Jan E. Schotsman" <email@hidden>)
 >Re: NSOpenPanel problem (From: Ken Thomases <email@hidden>)
 >Re: NSOpenPanel problem (From: "Jan E. Schotsman" <email@hidden>)
 >Re: NSOpenPanel problem (From: Conrad Shultz <email@hidden>)
 >Re: NSOpenPanel problem (From: "Jan E. Schotsman" <email@hidden>)

  • Prev by Date: Re: NSOpenPanel problem
  • Next by Date: Re: NSOpenPanel problem
  • Previous by thread: Re: NSOpenPanel problem
  • Next by thread: Re: NSOpenPanel problem
  • Index(es):
    • Date
    • Thread