【发布时间】:2012-01-09 10:42:28
【问题描述】:
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'
这是我今晚遇到的错误。我在 interfacebuilder 中将 CPTGraphHostingView 的类名设置为我的 uiview。
【问题讨论】:
-
在你的代码中试试这个 CPTGraphHostingView *hostingView = (CPTGraphHostingView *)self.view;
-
CPTGraphHostingView *hostingView = (CPTGraphHostingView *)self.view;这是我在我的代码中使用的!
-
关于未读取的界面生成器。说未知类是问题,即使我在界面生成器中为 UIView 提供了正确的类以获取条形图