In my header file, I have this code:
@interface TableViewController : UIViewController
{
IBOutlet UITableView *tblListData;
NSArray *arryData;
}
In my class declaration file, I have this implementation:
- (void)viewDidLoad
{
arryData = [[NSArray alloc] initWithObjects:@"iPhone",@"iPod",@"MacBook",nil];
[super viewDidLoad];
}
Now I get this Xcode warning: NSArray may not respond to -addObject
for the following code:
- (IBAction)AddButtonAction:(id)sender
{
[arryData addObject:@"Mac Mini"];
[tblListData reloadData];
}
And, sure enough, my NSArray
is not responding to addObject
! :(
What should I do?