Skip to content

Instantly share code, notes, and snippets.

@Nub
Created September 30, 2011 08:48
Show Gist options
  • Select an option

  • Save Nub/1253139 to your computer and use it in GitHub Desktop.

Select an option

Save Nub/1253139 to your computer and use it in GitHub Desktop.
if(stocks)
{
NSMutableDictionary *serialStocks = [NSMutableDictionary dictionary];
for (NSString *key in stocks) {
NSMutableArray *serialPurchases = [NSMutableArray array];
NSArray *item = [stocks objectForKey:key];
if ([item isKindOfClass:[NSArray class]]) {
for (StockPurchase *purchase in item) {
NSDictionary *serialPurchase = [purchase serializeToDictionary];
[serialPurchases addObject:serialPurchase];
}//purchase in item
}//if array
[serialStocks setObject:serialPurchases forKey:key];
}//ket in stocks
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment