w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Objective C interface declaration

Object is the OBJC_ROOT_CLASS for ObjC 1.0, for ObjC 2.0 use NSObject and #import <Foundation/Foundation.h>. You'll also have to add the -framework Foundation as a compiler flag if you are compiling using clang or gcc on the command line. See the header file Object.h:

#if __OBJC__  &&  !__OBJC2__

@interface Object

Note the #if __OBJC__ && !__OBJC2__.

EDIT: I actually managed to find that: When writing code that is based upon the Foundation framework, that root class is typically NSObject in an old document... The OBJC_ROOT_CLASS got me confused, so even if you're using ObjC 1.0 it's still NSObject.

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.