Re: NSPredicate and custom sort selector

2014-05-31 Thread Trygve Inda
A string is a string - the user's input will have the ratioValue property available. Up to you to sanity check the user input of course. Kirk Kerekes (iPhone) On May 30, 2014, at 4:56 PM, Trygve Inda cocoa...@xericdesign.com wrote: Create a property-styled category on NSString

Re: NSPredicate and custom sort selector

2014-05-30 Thread Trygve Inda
On May 29, 2014, at 2:52 PM, Trygve Inda wrote: 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

Re: NSPredicate and custom sort selector

2014-05-30 Thread Kirk
Create a property-styled category on NSString that returns the numeric value of a ratio-string -- call it ratioValue perhaps. Then you can have a predicate format of the form: @self.ratioValue %@.ratioValue -- or whatever. The same category would be useful in KVC collection operations.

Re: NSPredicate and custom sort selector

2014-05-30 Thread Trygve Inda
Create a property-styled category on NSString that returns the numeric value of a ratio-string -- call it ratioValue perhaps. Then you can have a predicate format of the form: @self.ratioValue %@.ratioValue -- or whatever. The same category would be useful in KVC collection

Re: NSPredicate and custom sort selector

2014-05-30 Thread Trygve Inda
Create a property-styled category on NSString that returns the numeric value of a ratio-string -- call it ratioValue perhaps. Then you can have a predicate format of the form: @self.ratioValue %@.ratioValue -- or whatever. The same category would be useful in KVC collection

Re: NSPredicate and custom sort selector

2014-05-30 Thread Kirk
A string is a string - the user's input will have the ratioValue property available. Up to you to sanity check the user input of course. Kirk Kerekes (iPhone) On May 30, 2014, at 4:56 PM, Trygve Inda cocoa...@xericdesign.com wrote: Create a property-styled category on NSString that

NSPredicate and custom sort selector

2014-05-29 Thread Trygve Inda
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

Re: NSPredicate and custom sort selector

2014-05-29 Thread Ken Thomases
On May 29, 2014, at 2:52 PM, Trygve Inda wrote: 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

Re: NSPredicate and custom sort selector

2014-05-29 Thread Trygve Inda
On May 29, 2014, at 2:52 PM, Trygve Inda wrote: 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