使用核心图时,应用程序崩溃
问题描述:
Unknown class CPTGraphHostingView in Interface Builder file.
2012-01-09 16:09:34.242 ChartArea[2595:207] -[UIView setHostedGraph:]: unrecognized selector sent to instance 0x4c064f0
2012-01-09 16:09:34.245 ChartArea[2595:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setHostedGraph:]: unrecognized selector sent to instance 0x4c064f0'
这是我今天晚上遇到的错误。我在接口生成器中将CPTGraphHostingView的类名设置为我的uiview。
This is the error I am getting this evening. i am setting the class name of to CPTGraphHostingView to my uiview within interfacebuilder.
答
我遇到了同样的问题,这对我有用:
I had the same problem and this worked for me:
从Xcode的导航器面板中选择项目,然后
突出显示Build Settings选项卡。过滤设置或从此列表中找到其他
Linker Flags,然后将-ObjC -all_load添加到这些
设置
Select your project from the navigator panel in Xcode and then highlight the Build Settings tab. Filter the settings or locate ‘Other Linker Flags’ from this list and then add -ObjC -all_load to these settings
(从这里: http://www.johnwordsworth.com/2011/10/adding-charts-to-your-iphone-ipad-app-using-core-plot/ )