我只是实现我的课[MyClassName copyWithZone:]:发送到实例的无法识别的选择器?
@interface ExampleNestedTablesViewController()
{
NSMutableArray *projectModelArray;
NSMutableDictionary *sectionContentDictionary;
}
- (void)viewDidLoad
{
[super viewDidLoad];
ProjectModel *project1 = [[ProjectModel alloc] init];
project1.projectName = @"Project 1";
ProjectModel *project2 = [[ProjectModel alloc] init];
project2.projectName = @"Project 2";
if (!projectModelArray)
{
projectModelArray = [NSMutableArray arrayWithObjects:project1, project2, nil];
}
if (!sectionContentDictionary)
{
sectionContentDictionary = [[NSMutableDictionary alloc] init];
NSMutableArray *array1 = [NSMutableArray arrayWithObjects:@"Task 1", @"Task 2", nil];
[sectionContentDictionary setValue:array1 forKey:[projectModelArray objectAtIndex:0]]; // **this line crashed**.
}
}
这里是我的项目模型
@interface ProjectModel : NSObject
typedef enum
{
ProjectWorking = 0,
ProjectDelayed,
ProjectSuspended,
} ProjectStatus;
@property (nonatomic, assign) NSInteger idProject;
@property (nonatomic, strong) NSString* projectName;
@property (nonatomic, strong) NSMutableArray* listStaff;
@property (nonatomic, strong) NSTimer* projectTimer;
@property (nonatomic, assign) ProjectStatus projectStatus;
@property (nonatomic, strong) NSMutableArray* listTask;
@property (nonatomic, assign) NSInteger limitPurchase;
@property (nonatomic, strong) NSDate* limitTime;
@end
,输出是: SDNestedTablesExample [1027:C07] - [ProjectModel copyWithZone:]:无法识别的选择发送到实例0x7562920。 我不知道哪个问题。你可以帮我吗 ?