I need to mix cpp and objective-c in one header file and mm file, (CFacebookInterface.h,CFacebookInterface.mm)
but if I add a BOOL OR NSURL in header file.
I get a error ” BOOL” does not name a type AND “NSURL” does not name a type
IF I #import Foundation/NSURL.h in this header then “GET 375 ERROR “
IF I #import Foundation/Foundation.h then “COMPILING WILL GET 999+ ERROR “
and all the errors are occured in ios`s framework class like NSZone.h,NSObject.h etc..
Anybody can help …thanks very much….
//#import <Foundation/Foundation.h> //GET 999+ ERROR
//#import <Foundation/NSURL.h> //GET 375 ERROR
#import <SocialInterface.h>
class CFacebookInterface : public SocialInterface
{
public:
CFacebookInterface();
virtual ~CFacebookInterface();
public:
virtual void setAppID(CStrWChar key);
virtual const char* getAttributeName();
virtual const char* getUserAliasAttributeName();
virtual void login();
virtual void finishLogin();
virtual void logout();
virtual void finishLogout();
virtual void loadFriends();
virtual void finishLoadFriends();
virtual int32 getConnectionState();
virtual CStrWChar getPlayerID();
virtual CStrWChar getPlayerAlias();
virtual int32 getFriendsCount();
virtual CStrWChar getFriendIDAtIndex( int index );
virtual void postMessage();
virtual void postMessage(const CStrWChar & msg);
virtual void FinishPostMsg(boolean suc);
virtual void resume();
BOOL handleOpenURL(NSURL* url);
};
#endif //__FACEBOOKINTERFACE__
Rename your
.cppfiles to.mmto have access to both, Objective-C and C++.