My app is crashing with the error: +[AccountService createMockAccountData] unrecognized selector sent to class 0x89e40..Please advise how can I resolve this error? I’m new to Objective C. Here’s my code:
@interface AccountService : NSObject
+ (NSMutableArray *)accounts: createMockAccountData;
@end
#import AccountService.h"
@implementation AccountService
+(NSMutableArray *)accounts: createMockAccountData{
NSMutableArray * accounts = [[NSMutableArray alloc] init];
UserAccount *mockUserAccount1 = [[UserAccount alloc] init];
*mockUserAccount1 setName:@"Stella"];
[accounts addObject:mockUserAccount1];
UserAccount *mockUserAccount2 = [[UserAccount alloc] init];
[mockUserAccount2 setName:@"Marko"];
[accounts addObject:mockUserAccount2];
[mockUserAccount1 release];
[mockUserAccount2 release];
return accounts;
}
….
In my controller…I’m invoking this class method like this:
NSMutableArray *accounts = [AccountService createMockAccountData];
NSUInteger count = [accounts count];
NSLog(@"# of records = %d",count);
Thanks!
change
to