I have a textfield that I am trying to have the data sent to a Mutable Array when the user presses done. The only way this works is when I do textFieldArray = [[NSMutableArray alloc]initWithObjects:self.textField.text, nil]; but then it rewrites the mutable array when the user taps adds another object.
Here is my code:
- (IBAction)doneButton:(id)sender {
[self resignFirstResponder];
[textFieldArray addObject:self.textField.text];
NSLog(@"array: %@", textFieldArray);
}
This may be flagged as a duplicate question but I cannot find anything that solves my problem, Thanks for helping.
(null)initmethod.