Re: C/Obj-C API Confusion
Re: C/Obj-C API Confusion
- Subject: Re: C/Obj-C API Confusion
- From: "J. Todd Slack" <email@hidden>
- Date: Wed, 10 Sep 2008 14:31:08 -0700
Hi Sherm,
So if I have an objective C class, how can I call a .c class? and pass
my arguments from the objective-c class?
-Jason
On Sep 10, 2008, at 12:56 PM, Sherm Pendley wrote:
On Wed, Sep 10, 2008 at 3:44 PM, J. Todd Slack <email@hidden
> wrote:
I had a conversation with an Apple Engineer a few days ago and he
recommended that I switch to the Quicktime C API rather than the
Objective-C api for what I needed to do.
I have a few questions.
Okay - I'll skip to the last one, since the answer to it makes the
others moot. :-)
3. Can one mix C and Objective-C in the same file?
Yes. Objective-C is a superset of C, so C functions can be called
directly from Objective-C.
Maybe I can keep the Objective-C stuff I already have done and just
write the c code for QT integration that I need?
Yep.
If I pass in an NSString from AppleScript do I need to convert it a
C-String?
Assuming the C function to which you're passing it was declared as
taking a char*, i.e. a C string, then yes, you'll have to convert
it. NSString's -cStringUsingEncoding: will do that for you.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
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