How to create an NSDictionary with multiple keys?

前端 未结 5 843
臣服心动
臣服心动 2020-12-30 12:34

I am not sure if what I am going to ask is actually an NSDictionary with multiple keys but ok.

What I want to do is create an NSDictionary

5条回答
  •  遥遥无期
    2020-12-30 13:28

    How to Create NSArray and with Access for object using NSDictionary ?

    ... Create NSArray

    NSArray *studentkeys = [NSArray arrayWithObjects:@"studentName", @"studentBirthDate", @"studentCity", @"studentMobile"  nil];
    
    NSArray *objects = [NSArray arrayWithObjects:@"Pravin", @"27/08/1990", @"Bhavnagar",@"7878007531", nil]; 
    

    ...to Access to NSArray Object Using NSDictionary

    NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:objects forKeys:keys];                                  
    

提交回复
热议问题