Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 31st, 2012  |  syntax: None  |  size: 0.92 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Which type I should use to save many objects with same key? (iOS)
  2. {
  3.   @"suggestedTo" = 111,
  4.   @"suggestedTo" = 222,
  5.   @"suggestedTo" = 333,
  6.   etc.
  7. }
  8.        
  9. NSSet *suggestedTo = [NSSet setWithObjects:[NSNumber numberWithInt:111],
  10.                                            [NSNumber numberWithInt:222],
  11.                                            [NSNumber numberWithInt:333], nil];
  12. NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:suggestedTo,
  13.                                                                 @"suggestedTo", nil];
  14.        
  15. NSArray      *suggestedTos = [[NSArray alloc] initWithObjects:
  16.                                [NSNumber numberWithInt:111],
  17.                                [NSNumber numberWithInt:222],
  18.                                [NSNumber numberWithInt:333], nil];
  19.  
  20. NSDictionary *myDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:
  21.                                suggestedTos, @"suggestedTo", nil];