0

I have a UIPickerView with three components, and each component has NSIntegerMax for the numbers. So, I just need to get the data from each component, and send it to another ViewController called, CreationViewController. The three objects I need to send are strings, set up like so:

NSInteger supplyData = [supplypick selectedRowInComponent:0];
NSInteger mineralData = [supplypick selectedRowInComponent:1];
NSInteger vespeneData = [supplypick selectedRowInComponent:2];

So, I would like to add each cell in the format of this log:

  NSLog(@"%i  %@  M:%i  G:%i", supplyData, namer.text, mineralData, vespeneData);

All I need to know it what to put...

 NSMutableArray * array = [[NSMutableArray alloc] init];
 [array addObject:        ];
                  ^^HERE^^

This is all in one function. Please help! Thanks!

Nathan
  • 151
  • 4
  • 16

1 Answers1

0
[array addObject:[NSString stringWithFormat:@"%i  %@  M:%i  G:%i", supplyData, namer.text, mineralData, vespeneData]];
omz
  • 53,243
  • 5
  • 129
  • 141
  • It looks great, but I want to add it to a plist with strings, called CreationArray.plist. How could I do that? – Nathan Jan 21 '11 at 02:56
  • Just write your array to the file using -writeToFile:atomically: This will generate a plist with some default format. Use NSPropertyListSerialization if you need more control over the output. – omz Jan 21 '11 at 16:37
  • Actually, I want to add it to another array in a different class. I've imported the class, but I don't know what to do after the equals sign, like, CreationViewController * creation =... How could I do that? Thanks for your help. – Nathan Jan 26 '11 at 23:31