Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Create a dictionary which contain an array

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 235
    Comment on it

    To create a dictionary which contain an array below tutorial will help you.
    In this blog firstly we create a NSArray which contain some value and after that I have displayed all the value and then created a NSMutableDictioary and provide a key to the array1 and after that display the dictionary. In this way you can create a dictionary which contain the array.

      NSArray *array1 = [NSArray arrayWithObjects:@"Lalit",
                         [NSNumber numberWithInteger:13],
    
                         [NSArray arrayWithObjects:@"Mohan",@"Sharma",nil],
    
                         nil];
    
    NSLog(@"The array contain the following element %@",array1);
    
    
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    [dict setObject:array1 forKey:@"data"];
    
    NSLog(@"the dictionary is %@",dict);
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: