On Sun, Mar 28, 2010 at 9:18 AM, William Squires <wsqui...@satx.rr.com> wrote: > ... and other things. > > 1) I have a C library (as a .c and .h) file. I want to encapsulate this > functionality in an ObjC class. When importing header files into my > implementation file ".m", do I #include them or #import them? How about > existing library headers (like <string.h>)?
You can do either. > 2) If my C code uses malloc/free, and my ObjC project has garbage collection > turned on, what 'gotcha's do I have to watch out for? What if GC is turned > off (for iPhone)? The Garbage collector completely ignores memory allocated via malloc. Regardless of whether or not GC is on, you are still responsible for free()'ing malloc()'ed memory. You also have to be careful about putting pointers to objects into any malloc()'ed memory, as the collector will not count that as an active reference, and the object may get collected before you might expect it. -- Clark S. Cox III clarkc...@gmail.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com