Before I get roasted let me say that I have looked at almost all the answers to "unrecognized selector sent to instance" and tried some of the suggestions but nothing seems to work. So here is my question.
I call my function CreateAboutData
in the viewDidLoad
function.
-(void)createAboutData
{
NSMutableArray *aboutText;
aboutSections = [[NSMutableArray alloc] initWithObjects:@"About", nil];
aboutText = [[NSMutableArray alloc] init];
//Set About Info
[aboutText addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Scoring",@"title",@"Scoring blurb", @"text", nil]];
aboutData = [[NSMutableArray alloc] initWithObjects:aboutText, nil];
[aboutText release];
}
The controller i.e. aboutView
is called by by my HomeView
Controller.
AboutViewTableController *aboutNavController = [[AboutViewTableController alloc] initWithNibName:@"AboutViewTableController" bundle:nil];
aboutNavController.title = @"About One";
// Create the nav controller and add the view controllers.
UINavigationController *theNavController = [[UINavigationController alloc] initWithRootViewController:aboutNavController];
// Display the nav controller modally.
[self presentModalViewController: theNavController animated:YES]; <==== THIS IS WHERE IT FAILS
When the code fails it complains that:- -[__NSArrayM length]: unrecognized selector sent to instance .
aboutData is declared in the header along with the createData function as follows:
@interface AboutViewTableController : UITableViewController {
NSMutableArray *aboutData;
NSMutableArray *aboutSections;
}
-(void)createAboutData;
@end
So the question is why is it raising an exception I have been racking and trying different avenues to no avail. I have also tried making aboutData a property with retain and nonatomic set but the same problem arises. Am puzzled too because no where to query for the length. Thanks