EmployeesArray = [[NSMutableArray alloc] initWithCapacity:100];
Employees *Emp1 = [[Employees alloc] init];
Emp1.Number = 1;
Emp1.Name = @"Jamal";
Emp1.Age = 16;
Emp1.Gender = @"Male";
[EmployeesArray addObject:Emp1];
[Dic1 setValue:Emp1 forKey:@"A"];
- (IBAction)Retrieve:(id)sender {
Employees *objEmp2 = [Dic1 valueForKey:@"A"];
printf(objEmp2.Name);
}
Why this code doesn’t retrieve the name ?? and error is appeared ??
Have you initialized the
Dic1dictionary?