Return NSArray from NSDictionary

后端 未结 3 1478
太阳男子
太阳男子 2021-01-21 17:58

I have a fetch that returns an array with dictionary in it of an attribute of a core data object.

Here is my previous question: Create Array From Attribute of NSObject F

3条回答
  •  遇见更好的自我
    2021-01-21 18:16

    To get the type of array you want, you can do something like this:

    NSMutableArray *array = [[NSMutableArray alloc] init];
    for (int n = 0; n < [data count]; n++) // data array 
     {  
        NSMutableArray *array = [[NSMutableArray alloc] init];
        array = [NSMutableArray arrayWithObjects:[[data objectAtIndex:n] valueForKey:@"timeStamp"] ,nil];
       if ([array count] != 0) {
        [newArray addObject:[array objectAtIndex:0]];
        }
      }
     [array release];
    

    hope this will help you!!

    ~Manoj

提交回复
热议问题