views:

95

answers:

1

I've found references online that talk about two different root classes for ObjC, either objc/Object.h or Foundation/NSObject.h. They require different compiler flags (-lobj vs. -lobjc -framework Foundation, and have different selectors for initializing & releasing objects. Is NSObject a replacement, or do they have different applications? Obviously NSObject.h would be better for NextStep-type stuff, but does Object.h have advantages that would make it better in certain situations?

FWIW, the updated FAQ from comp.lang.objective-c seems to indicate the NSObject.h is correct; an older version mentions Object.h

+6  A: 

My understanding of the situation is there are two runtime libraries for Objective-C. Apple's library, which uses NSObject, and the GNU library which uses Object. If you are developing for an Apple platform, use their runtime. If you're developing for a non-Apple platform, you use the other.

jkf