我出错了,NSInvalidArgumentException,这是我的模型类
+(NSArray *)users
{
NSDictionary *user1 = @{@"username" : @"master photographer", @"email" : @"worldtravel@me.com", @"password" : @"drowssap", @"age" : @24, @"profilePicture" : [UIImage imageNamed:@"person1.jpeg"]};
NSDictionary *user2 = @{@"username" : @"Lots of tots", @"email" : @"otterskips@me.com", @"password" : @"icecreamrocks", @"age" : @65, @"profilePicture" : [UIImage imageNamed:@"person2.jpeg"]};
NSDictionary *user3 = @{@"username" : @"iTechie", @"email" : @"theRealApple@me.com", @"password" : @"infiniteloop", @"age" : @30, @"profilePicture" : [UIImage imageNamed:@"person3.jpeg"]};
NSDictionary *user4 = @{@"username" : @"Royal", @"email" : @"king@me.com", @"password" : @"IGotAPalace", @"age" : @0, @"profilePicture" : [UIImage imageNamed:@"person4.jpeg"]};
NSArray *userArray = @[user1, user2, user3, user4];
return userArray;
}
@end这是我的观点
self.users = [DMZUserData users];
NSLog(@"%@", self.users);发布于 2015-02-11 13:24:31
“尝试从objects4插入nil对象”意味着索引4处的键或值为nil。
因此,正如其他人所说的,这将是您的图像之一,因为索引4的键是字符串文本。
https://stackoverflow.com/questions/23298615
复制相似问题