I am trying to insert my custom object BalanceData to NSMutableArray and I get an error:
No known class method for selector 'balnce'
My code:
- (void)insertNewObject:(id)sender
{
if (!_balances) {
_balances = [[NSMutableArray alloc] init];
}
[_balances insertObject:[BalanceData balance] atIndex:0]; // error occures here
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
}
MasterViewController.m top:
#import "MasterViewController.h"
#import "DetailViewController.h"
#import "BalanceData.h"
@interface MasterViewController () {
NSMutableArray *_balances;
}
@end
@implementation MasterViewController
@synthesize balances = _balances;
How can I do it in proper way ?