如何通过单击使用此方法的按钮在数组中添加对象:
- (void)insertNewObject:(id)sender
{
[orderListe addObject:[[DataOrder alloc]initWithName:@"Michael" price:18 taille:@"junior" supplement:@"boeuf"]];
}
当我这样做时,我的应用程序崩溃并说:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DataOrder initWithName:]: unrecognized selector sent to instance 0x8aa4fa0'
我能做些什么来简单地将对象添加到数组中?谢谢