Heya!
Yet another noob to OBJ-C and iPhone programming. Although not a newby when it comes to programming in general.
Never been a big mac fan, but the iPhone 3G was too good not to get. And that got me to lend a Mac mini to do some coding for it. Maybe I'll turn into a mac-guy one day :O
Anyway, right to the point. I'm making a game and to avoid getting too deep into OBJ-C I decided to stick with more C than OBJ-C. Now I wanted to load some resources, but to get the path to the resource I apparently needed some OBJ-C:
fileString = (CFStringRef)[[NSBundle mainBundle] pathForResource"FileName" ofType"ext"];
Well, the problem is that when I include stuff like UIKit to get that line to compile I get all kind of weird errors. Inporting UIKit in my C header gives me > 1000errors.
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:120: error: syntax error before '@' token
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:122: error: syntax error before '*' token
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:123: error: syntax error before '*' token
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:125: error: syntax error before '*' token
etc....
What am I doing wrong?
Thanks in advance!
Nixarn
Yet another noob to OBJ-C and iPhone programming. Although not a newby when it comes to programming in general.
Never been a big mac fan, but the iPhone 3G was too good not to get. And that got me to lend a Mac mini to do some coding for it. Maybe I'll turn into a mac-guy one day :O
Anyway, right to the point. I'm making a game and to avoid getting too deep into OBJ-C I decided to stick with more C than OBJ-C. Now I wanted to load some resources, but to get the path to the resource I apparently needed some OBJ-C:
fileString = (CFStringRef)[[NSBundle mainBundle] pathForResource"FileName" ofType"ext"];
Well, the problem is that when I include stuff like UIKit to get that line to compile I get all kind of weird errors. Inporting UIKit in my C header gives me > 1000errors.
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:120: error: syntax error before '@' token
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:122: error: syntax error before '*' token
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:123: error: syntax error before '*' token
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:125: error: syntax error before '*' token
etc....
What am I doing wrong?
Thanks in advance!
Nixarn