0

我正在 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)

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

谢谢你!

4

2 回答 2

0

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

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

当然pickerAppDeligateVar用适当的变量名替换并试一试。

于 2013-06-07T05:10:09.180 回答
0

错误信息

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

意味着您没有实施

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

中的方法Website_PickerViewController作为选择器视图的数据源。

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

于 2013-06-07T05:17:07.073 回答