NSPredicate and custom sort selector
NSPredicate and custom sort selector
- Subject: NSPredicate and custom sort selector
- From: Trygve Inda <email@hidden>
- Date: Thu, 29 May 2014 12:52:52 -0700
- Thread-topic: NSPredicate and custom sort selector
I have an array of objects. One property of this object is a ratio stored as
a string (e.g. 5:8, 9:4, 21:2) etc.
I have a category on NSString:
-(NSComparisonResult)compareAspectString:(NSString *)aString
This does the division and compares the aspect ratios correctly.
Now I need a predicate to do this.
My Predicate says:
Printing description of predicate:
aspectRatio >[cd] "4:3"
But it is just doing straight string comparison. How can I get the predicate
to use by comparison method?
The columns in my NSTableView are able to use this custom sort function...
Seems a predicate should be able to use it too.
Thanks,
Trygve
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden