Hello frnds actually i have a array of arrays as given below:-`
parrent array{
PrArr =
(
{
dt = "01-Apr-2012 11:15 PM\n";
dur = "15\n\t\t";
name = "Tez Special\n\t\t";
},
{
dt = "01-Apr-2012 11:30 PM\n\n";
dur = "30\n\t\t";
name = "Tez Tare\n\t\t";
}
);
sid = "530\n";
},
{
PrArr = (
{
dt = "01-Apr-2012 11:20 PM\n";
dur = "20\n\t\t";
name = "Shiv Yog - Acharya Ishan Shivanandji\n\t\t";
},
{
dt = "01-Apr-2012 11:40 PM\n\n\n\t";
dur = "20\n\t\t";
name = "Param Pujya Swami HariChaitanya Puriji Maharaj\n\t\t";
};
sid = "560\n";
},
}
i want to fetch data according to sid in a array.
Thanx in advance
If you are trying to do find the dictionary where the sid is equal a something, then you will need to use NSPredicate.
From apple documentation:
With NSPredicate you can find all sid that correspond to your search.
I will give you an example. Based on the array you posted here, you want to return the entry that have the sid equals to @”530\n”, what you will need to do is:
But if you are trying to sort your array based on the sid, you can use the NSSortDescriptor, that will return your array sorted based in the sid.
From apple documentation:
One example for you