In my view controller (viewDidLoad) I am populating an array defined in the view controllers header file with settings data (from an archive). I am using data from the array to write labels on buttons in the view, no problem so far.
I would like to pass one element of the array through an IBAction to add to the new view controller. I keep getting an error from within the IBAction
'NSInvalidArgumentException', reason: '-[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x5d230f0').
Here is the relevant part of my IBAction code:
-(IBAction)pushedTimer:(id)sender {
if (!timerViewController) {
timerViewController = [[TimerViewController alloc] init];
}
[timerViewController setPreset:[[settingsArray objectAtIndex:0] settingLength]];
[[self navigationController] pushViewController:timerViewController animated:YES];
}
I was thinking that since the array is accessible in other methods, it should also work with the IBAction? The error leads me to believe that the IBAction can not determine that the settingsArray is really an array?
Thanks again.