So I have an NSArray with custom objects called Church. And in each church there is an array of mass times. So there is a method in church which calculates the closest mass to the user's current time.
-(NSDate *)closestTimeTo:(NSDate *)currentTime
I want to be able to sort the NSArray of Church by the results (which are NSDate) returned by that method for each object. Basically to get a sorted list of masses sorted by the closest time and also location.
I'm using categories and can't store the closest times as properties since its a core data object. I also don't think its a good idea to save those values to core data as these methods will be called constantly due to location services.
Any ideas on how I can sort such array using the result of its objects' method?