Xcode 4.6上的llbd错误

时间:2013-06-07 04:41:19

标签: c++ objective-c c

我正在Xcode 4.6上创建一个网站选择器应用程序,除了我尝试运行它之外没有任何问题我会发送错误的调试器。

return UIApplicationMain(argc, argv, nil, NSStringFromClass([Website_PickerAppDelegate class]));

^^这是以绿色突出显示的,其中有1号线:信号SIGABRT。

它还有:

2013-06-06 23:29:53.698 Website Picker[1185:c07] -[Website_PickerViewController pickerView:numberOfRowsInComponent:]: unrecognized selector sent to instance 0x75614f0
2013-06-06 23:29:53.699 Website Picker[1185:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Website_PickerViewController pickerView:numberOfRowsInComponent:]: unrecognized selector sent to instance 0x75614f0'
*** First throw call stack:
(0x1c92012 0x10cfe7e 0x1d1d4bd 0x1c81bbc 0x1c8194e 0xc691 0xf41a 0x1f8548 0x1fb224 0xbf952
 0xbf2dc 0xdff8 0x642dd 0x10e36b0 0x228efc0 0x228333c 0x228eeaf 0x1032bd 0x4bb56 0x4a66f 0x4a589
 0x497e4 0x4961e 0x4a3d9 0x4d2d2 0xf799c 0x44574 0x4476f 0x44905 0x4d917 0x234b 0x11157 0x11747 
 0x1294b 0x23cb5 0x24beb 0x16698 0x1beddf9 0x1bedad0 0x1c07bf5 0x1c07962 0x1c38bb6 0x1c37f44 
 0x1c37e1b 0x1217a 0x13ffc 0x2052 0x1f85)
libc++abi.dylib: terminate called throwing an exception
(lldb)

有人可以告诉我这是什么问题吗?

谢谢!

2 个答案:

答案 0 :(得分:0)

问题可能存在,因为Website_PickerAppDelegate是类名而不是变量名,除非您将变量名称大写。它需要像

return UIApplicationMain(argc, argv, nil, NSStringFromClass([pickerAppDeligateVar class]));

当然,用适当的变量名称替换pickerAppDeligateVar,然后开始使用。

答案 1 :(得分:0)

错误消息

-[Website_PickerViewController pickerView:numberOfRowsInComponent:]: unrecognized selector sent to instance 0x75614f0

表示您未实现

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component

方法在Website_PickerViewController中充当选择器视图的数据源。

(如果您认为自己实现了它:检查输入错误,例如大写/小写 方法名称中的字母。)