• 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: Michael Babin <email@hidden>
  • Date: Sat, 12 Nov 2011 13:56:45 -0600

On Nov 11, 2011, at 8:34 PM, Charles Srstka wrote:

> On Nov 11, 2011, at 8:22 PM, Wim Lewis wrote:
>
>> On Nov 11, 2011, at 5:49 PM, Nathan Sims wrote:
>>> (OSX 10.6.8, Xcode 3.2.6)
>>
>> int get_float_data(float *result1, float *result2)
>> {
>> NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
>> @try {
>>  [objcCode call];
>>  *result1 = [more stuff];
>>  etc.;
>> } @catch {
>>  fprintf(stderr, "omg doomed!\n");
>>  etc.;
>> } @finally {
>>  [pool drain];
>> }
>>
>> return blahblah;
>> }
>
> In this day and age, you should probably just use @autoreleasepool instead of NSAutoreleasePool:

Note: use of Xcode 3.2.6.

@autoreleasepool is not available there. I believe it requires Xcode 4.2 and LLVM (Clang) 3.0.

_______________________________________________

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: Charles Srstka <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