SEL
ボタンセレクターに設定したい変数があります。
私のコードは次のようになります。
GridView *ObjGridView=[[GridView alloc]initWithFrame:frame];
[[NSBundle mainBundle ] loadNibNamed:@"GridView" owner:ObjGridView options:nil];
CATEGORY *ObjCategory=[arrCategory objectAtIndex:index];
//do something
ICON *ObjIcno=[ObjCategory.arrIconObjects objectAtIndex:indexIcon];
[ObjGridView.button1 addTarget:self action:ObjIcno.handler forControlEvents:UIControlStateNormal];
ObjIcno.handler
SEL 変数です (これは、以前に selector によって設定されています)
このような:
arrSectonProductivityTools=[NSMutableArray arrayWithObjects:[[[ICON alloc]initWithIcon:@"firefox.png":@"Firefox":@selector(FirefoxCickEvent:)] autorelease],nil];
この方法でクラスにセレクターを設定しましたが、これは正しく設定されていますが、クリックイベントが発生しません。