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!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.
回答2:
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.