mam błędzie NSInvalidArgumentException to moja klasa modeluNSInvalidArgumentException 'REAS - [__ NSPlaceholderDictionary initWithObjects: znalezienia kluczy: Ilość:]: wkładać do nil obiekt od obiektów [4]'
+(NSArray *)users
{
NSDictionary *user1 = @{@"username" : @"master photographer", @"email" : @"[email protected]", @"password" : @"drowssap", @"age" : @24, @"profilePicture" : [UIImage imageNamed:@"person1.jpeg"]};
NSDictionary *user2 = @{@"username" : @"Lots of tots", @"email" : @"[email protected]", @"password" : @"icecreamrocks", @"age" : @65, @"profilePicture" : [UIImage imageNamed:@"person2.jpeg"]};
NSDictionary *user3 = @{@"username" : @"iTechie", @"email" : @"[email protected]", @"password" : @"infiniteloop", @"age" : @30, @"profilePicture" : [UIImage imageNamed:@"person3.jpeg"]};
NSDictionary *user4 = @{@"username" : @"Royal", @"email" : @"[email protected]", @"password" : @"IGotAPalace", @"age" : @0, @"profilePicture" : [UIImage imageNamed:@"person4.jpeg"]};
NSArray *userArray = @[user1, user2, user3, user4];
return userArray;
}
@end
i to jest mój viewDidLoad
self.users = [DMZUserData users];
NSLog(@"%@", self.users);
Jeden (lub więcej) z Twoich obrazów nie istnieje, co powoduje 'nil'. – rmaddy
Myślę, że komunikat o błędzie informuje, co jest nie tak. * Cokolwiek * na tej liście wartości słownika, które potencjalnie mogą być 'nil' ** wynosi **' nil'. Zrób trochę debugowania i znajdź to sam. – trojanfoe
Masz pytanie? – matt