の「終了編集」部分に接続された、次のを使用してにUITextField
入力を追加しようとしています。NSMutableArray
IBActions
UITextFields
- (IBAction) returnKey1
{
[textInputOne addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
[textInputOne resignFirstResponder];
[players addObject:textInputOne.text];
}
- (IBAction) returnKey2
{
[textInputTwo addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
[textInputTwo resignFirstResponder];
[players addObject:textInputTwo.text];
NSLog(@"array: %@",players);
}
viewDidLoad
そして、セクションのプレーヤー配列を次のように初期化しました。
- (void)viewDidLoad
{
[super viewDidLoad];
players = [[NSMutableArray alloc] init];
}
しかし、配列は「nil」のままです。誰でもこれを修正する方法を知っていますか?