hello, i am trying to use the GCMathParser for an iphone application and i cannot find any support on implementing this framework. people keep saying its easy and im kinda confused, any help would be great thanks!
+4
A:
There are two changes you need to make in order to use this:
- Change
#import <Cocoa/Cocoa.h>
to#import <UIKit/UIKit.h>
(You could probably get away with using<Foundation/Foundation.h>
, too) - Try to compile again. You'll get errors about an unknown symbol "pi". Change the three occurrences of those to
M_PI
(the constant defined in<math.h>
for π).
You'll still get warnings (about deprecated methods), but it will compile and work.
Dave DeLong
2009-10-01 19:40:19
worked perfectly thank you! im just not too accustomed with os x programming vs iphone programming i guess haha
Sj
2009-10-01 23:41:13
If you have any additional questions, Graham Cox, the author of GCMathParser, is very responsive.
Brad Larson
2009-10-02 00:37:43
+2
A:
If you have UI classes, then you will need to remove them (as you noted you have). If you have non-UI classes importing Cocoa.h, they generally shouldn't be (AppKit, which is implemented in Cocoa.h, is mostly UI). Replace Cocoa.h with #import <Foundation/Foundation.h>
. If they actually rely on things in Cocoa.h, then you have porting work to do.
Rob Napier
2009-10-01 19:41:08