Re: Calling a Cocoa library from C
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