I've got an interesting problem that I am sure someone would have come across. I am writing the front end UI in Objective C Cocoa, and the backend in C++. In C++ I have
#define NULL 0
Unfortunately, this has dire consequences for nil. Especially with nil terminated function calls as I now get this warning - "Missing sentinel in method dispatch", which I assume means it couldn't find the nil terminator. This is the only definition I could find for nil:
#ifndef NULL
#define NULL __DARWIN_NULL
#endif /* ! NULL */
#ifndef nil
#define nil NULL
#endif /* ! nil */
which seems to me that nil is NULL, and that my earlier define for NULL is messing everything up although I don't know how. The NULL is defined in C++ so that it can be platform independent. I have tried redefining NULL and nil, but nothing seems to take. Any suggestions on the correct way to go about this would be appreciated.