custom compare method in objective c
Posted
by Jonathan
on Stack Overflow
See other posts from Stack Overflow
or by Jonathan
Published on 2010-05-24T20:05:15Z
Indexed on
2010/05/24
20:41 UTC
Read the original article
Hit count: 380
I'm trying to use a custom compare method (for use with sortedArrayusingSelector) and on another website I got that the format is:
-(NSComparisonResult) orderByName:(id)otherobject { That's all bery well and good except how do I compare the otherObject to anything as there's only one thing passed to the method?
Like how does the NSString method of compare:
compare 2 strings when only one string is passed?
© Stack Overflow or respective owner