ここで私の髪を裂いています。これを回避する方法を説明する多くの例を読んだことがありますが、問題を取り除くのに役立つものはありませんでした。NSInvalidArgumentException
IBActionにリンクされたUIViewに単純なボタンがあります。
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIViewController buttonPressed:]: unrecognized selector sent to instance 0xd1d5f0'
タッチアップインサイド:
コードは常に、このエラーメッセージを受信
#import "Contact.h"
@implementation Contact
- (IBAction)buttonPressed:(id)sender
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Button Pressed" message:@"You pressed the button" delegate:nil cancelButtonTitle:@"Yep, I did." otherButtonTitles:nil];
[alert show];
[alert release];
}
Contact.m
この...Contact.h
#import <UIKit/UIKit.h>
@interface Contact : UIViewController {
}
-(IBAction)buttonPressed:(id)sender;
@end
ですファイルにリンクされているbuttonPressedを使用している所有者。
他のサンプルコードをダウンロードしても問題ありません。私のプロジェクトとペン先は、他のサンプルコードと同じように設定されています。
これを試してデバッグを開始する場合があります。
誰でも手伝ってください。
TouchUpイベントコールバックを確立するためにコードはどのように見えますか? – fbrereto