Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
UIButtonセレクターのパラメーターとして文字列を送信する必要があります。グローバル文字列を取得してもうまくいきません。ボタンはカスタムタイプです。私は試した :
UIButton
btn.titleLabel.text = str;
セレクターでアクセスしましたが、nilを受け取りました。
あなたはこのようにそれを得る
[b addTarget:self action:@selector(buttonTap:)forControlEvents:UIControlEventTouchUpInside]; -(IBAction)buttonTap:(id)sender { UIButton *b = (UIButton*)sender; NSLog(@"%@",b.titleLabel.text); }