我正在开发我的第一个真正的iPhone应用程序,一个简单的待办事项列表应用程序,以帮助我组织东西,除了我得到一个"无法识别的选择器发送到实例0x".
特别:
2010-02-20 14:30:09.200 ToDoApp[88562:20b] *** -[NSCFDictionary switchViews:]: unrecognized selector sent to instance 0x3d22de0
2010-02-20 14:30:09.201 ToDoApp[88562:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFDictionary switchViews:]: unrecognized selector sent to instance 0x3d22de0'
Run Code Online (Sandbox Code Playgroud)
我环顾四周,发现它可能是IB中的一个连接问题,但我对这整个连接事物都是新手(男人,我希望他们支持Java或Python),所以这里是如何布局的.我有3个类,一个SwitchViewController,一个MainScreenViewController和一个ToDoListViewController.当我点击MainScreenViewController上的一个按钮时,我触发了"switchViews"函数,这个函数引发了这个问题.他们设置的方式是按钮(一个UIBarButtonItem)将"sentAction"转到switchViews.这个ViewButton的参考出口作为SwitchViewController中的IBOutlet.
所以这里是SVC的.h:
#import <UIKit/UIKit.h>
@class MainScreenViewController;
@class ToDoListViewController;
@class EditViewController;
#define kMinimumGestureLength 25
#define kMaximumVariance 5
@interface SwitchViewController : UIViewController {
MainScreenViewController *mainScreenViewController;
ToDoListViewController *toDoListViewController;
EditViewController *editViewController;
IBOutlet UIBarButtonItem *viewButton;
CGPoint gestureStartPoint;
}
@property (retain, nonatomic) MainScreenViewController *mainScreenViewController;
@property (retain, nonatomic) ToDoListViewController *toDoListViewController;
@property (retain, …Run Code Online (Sandbox Code Playgroud)