there have already been lots of questions asked for Sorting of an NSMutableArray still am unable to find the exact solution for my problem.Kindly follow up:
I have an arrMasterArray which is something like this:
//This is an array of dictionaries with each element having dictionary at its index and key-value for the same.
<__NSArrayM 0x8bbaca0>(
{
"Brand_Description" = Accolate;
"Medication_DateStart" = "5/5/2012 12:00:00 AM";
},{
"Brand_Description" =Trisenox;
"Medication_DateStart" = "5/5/2012 12:00:00 AM";
}, {
"Brand_Description" = Ultiva;
"Medication_DateStart" = "5/5/2012 12:00:00 AM";
} ,{
"Brand_Description" = Accretropin;
"Medication_DateStart" = "5/5/2012 12:00:00 AM";
}
I apply sorting on arrMasterArray which returns me an sorted array but with only elements of that particular keyPath:
NSArray *arrNameCompare= [[arrMasterArray valueForKeyPath:@"Brand_Description"] sortedArrayUsingSelector:@selector(compare:)];
which outputs something like this:
<__NSArrayI 0x10e0efb0>( Accolate, Accretropin, Trisenox, Ultiva )
Now i want arrMasterArray to get sorted according to **arrNameCompare**
.
I searched a lot but no luck. Thanks for your patience and sorry for my english. Thanks Again.