i have just started swift. I want to learn just basics so i try to iterate in a mutable array which has dictionaries in it. I want to reach each values and keys of that dictionaries. I wrote such a code but i cant get the current dictionary in for loop.
Here how the plist looks
How should i iterate in such array ?
Code:
if let filePath = NSBundle.mainBundle().pathForResource("categories", ofType: "plist") {
var theRawData = NSMutableArray(contentsOfFile: filePath)
print("the raw data \(theRawData!)")
}
Here how the plist looks
(
{
categoryId = 1;
categoryName = Name1;
},
{
categoryId = 2;
categoryName = Name2;
},
{
categoryId = 3;
categoryName = Name3;
},
{
categoryId = 4;
categoryName = "Name4";
},
{
categoryId = 5;
categoryName = Name5;
},
{
categoryId = 6;
categoryName = Name6;
},
{
categoryId = 7;
categoryName = Name7;
},
{
categoryId = 8;
categoryName = "Name8";
}
)
How should i iterate in such array ?