• 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: Calling a Cocoa library from C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling a Cocoa library from C


  • Subject: Re: Calling a Cocoa library from C
  • From: Jens Alfke <email@hidden>
  • Date: Sat, 12 Nov 2011 11:20:34 -0800

On Nov 12, 2011, at 10:45 AM, Nathan Sims wrote:

> Okay, does this mean that an object instantiated by a C function has persistence across C function calls?

Yes. Think of Objective-C references as pointers to opaque structs, and treat them like any other generic pointer variable. You can store them in globals, locals, statics, struct fields, etc. Just be careful about retain/release guidelines, i.e. if you’re storing a reference to an object in something other than a local variable, you’d better retain it first (and release it when you’re done.)

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: 
 >Calling a Cocoa library from C (From: Nathan Sims <email@hidden>)
 >Re: Calling a Cocoa library from C (From: Wim Lewis <email@hidden>)
 >Re: Calling a Cocoa library from C (From: Nathan Sims <email@hidden>)

  • Prev by Date: Re: Calling a Cocoa library from C
  • Next by Date: Re: Calling a Cocoa library from C
  • Previous by thread: Re: Calling a Cocoa library from C
  • Next by thread: Re: Calling a Cocoa library from C
  • Index(es):
    • Date
    • Thread