Does anyone know how to fix a Thread 1: signal SIGABRT error? I have already tried cleaning my product. I'm new to iOS development

108 views Asked by At

I'm trying to use the dictionary function... some sites have told me to review my storyboard but I haven't created one..?

NSMutableDictionary * AllStudentsUpdated = [[NSDictionary alloc]initWithObjectsAndKeys:
                                      @"Avni Parikh", @"012700",
                                      @"Kyle Kurt", @"325325",
                                      @"Vidhi Shah", @"122146"
                                      , nil];
[AllStudentsUpdated setObject:@"Pallavi Patel" forKey:@"161616"];// this is where the error is 
1

There are 1 answers

1
Mohit Kumar On

You are initializing NSMutableDictionary with NSDictionary... just update your code to this.

NSMutableDictionary *AllStudentsUpdated = [[NSMutableDictionary alloc] initWithObjectsAndKeys: @"Avni Parikh", @"012700", @"Kyle Kurt", @"325325", @"Vidhi Shah", @"122146" , nil];

[AllStudentsUpdated setObject:@"Pallavi Patel" forKey:@"161616"];

Clean your build folder and run your app. That will solve your problem.