Hi, could anyone help with loading dictionary objects correctly into the array. Loading of plist into dictionary object works fine, and I was able to output some of it into command-line. Problem is that this way of loading bundles each Name and Price sets into same cell in the array. IE: Is it possible to load them separately? Or perhaps in some sort of 2d array with one cell for name and other for price.
Thanks in advance.
Test is a mutable array.
NSString* path = [[NSBundle mainBundle] pathForResource:@"property" ofType:@"plist"];
NSDictionary* amountData = [NSDictionary dictionaryWithContentsOfFile:path];
if (amountData) {
Test = [NSMutableArray arrayWithArray: amountData];
}
And my plist structure is:
<dict>
<key>New item</key>
<dict>
<key>Name</key>
<string>Property 1</string>
<key>Price</key>
<string>100000</string>
</dict>
<key>New item - 2</key>
<dict>
<key>Name</key>
<string>Property 2</string>
<key>Price</key>
<string>300000</string>
</dict>
<key>New item - 3</key>
<dict>
<key>Name</key>
<string>Property 3</string>
<key>Price</key>
<string>500000</string>
</dict>
<key>New item - 4</key>
<dict>
<key>Name</key>
<string>Property 4</string>
<key>Price</key>
<string>600000</string>
</dict>
</dict>