I have some Json input arrays that I want to sort. It is possible that some of the sort descriptors have null values. How can I protect against null value exceptions? Thanks.
What I have at present is:
//sort the group arrays
NSSortDescriptor *sortDescriptor1a;
NSSortDescriptor *sortDescriptor1b;
sortDescriptor1a = [[NSSortDescriptor alloc] initWithKey:@"Min" ascending:YES selector:@selector(caseInsensitiveCompare:)];
sortDescriptor1b = [[NSSortDescriptor alloc] initWithKey:@"Line" ascending:YES selector:@selector(caseInsensitiveCompare:)];
NSArray *sortDescriptors1 = [NSArray arrayWithObjects:sortDescriptor1a, sortDescriptor1b, nil];
NSArray *tempArray1 = [unsortedGroup1 sortedArrayUsingDescriptors:sortDescriptors1 ];
currentGroup1 = [tempArray1 mutableCopy];
NSSortDescriptor *sortDescriptor2a;
.....