Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects

2008-06-08 Thread Kyle Sluder
On Fri, Jun 6, 2008 at 6:53 PM, Adam R. Maxwell [EMAIL PROTECTED] wrote: So for an array of NSNumbers you could use -description and a -numericCompare: method that uses NSNumericSearch. In my opinion, it makes more sense to use -self and -compare: for NSDate/NSNumber. To me, option 1 only

Using NSSortDescriptor to reverse sort an NSArray containing NSString objects

2008-06-06 Thread George Stuart
So I searched through the cocoabuilder.com threads on array sorting to see what had been discussed regarding this topic. My goal is to reverse alphabetically sort an array of NSString objects. I saw a couple suggestions: 1. Categories to add funcationality to NSString and then use the

Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects

2008-06-06 Thread Ken Thomases
On Jun 6, 2008, at 4:16 PM, Adam R. Maxwell wrote: On Friday, June 06, 2008, at 02:07PM, George Stuart [EMAIL PROTECTED] wrote: The suggestion of using a keyPath of @self presents another question: 1) I assume NSSortDescriptor is using valueForKeyPath:, which in turns calls valueForKey:

Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects

2008-06-06 Thread Adam R. Maxwell
On Jun 6, 2008, at 2:51 PM, Ken Thomases wrote: On Jun 6, 2008, at 4:16 PM, Adam R. Maxwell wrote: On Friday, June 06, 2008, at 02:07PM, George Stuart [EMAIL PROTECTED] wrote: The suggestion of using a keyPath of @self presents another question: 1) I assume NSSortDescriptor is using

Re: NSArray to NSString

2008-04-13 Thread j o a r
On Apr 13, 2008, at 12:15 PM, Lincoln Green wrote: NSAttributedString *string = [textView attributedSubstringFromRange: [textView selectedRange]]; [textView setString:string]; You're passing an NSAttributedString to a method that expects a NSString. You probably would want to

Re: NSArray to NSString

2008-04-13 Thread Lincoln Green
Alright, the logic of this code(to me) is as follows; Make a new attributed string with the value of the textView's selected text. Then, print it in the console. But, of course, it doesn't work. what am I missing? NSAttributedString *aString = [[textView textStorage]

Re: NSArray to NSString

2008-04-13 Thread j o a r
On Apr 13, 2008, at 1:01 PM, Lincoln Green wrote: Alright, the logic of this code(to me) is as follows; Make a new attributed string with the value of the textView's selected text. Then, print it in the console. But, of course, it doesn't work. what am I missing? NSAttributedString

Re: Convert NSArray to NSString

2008-04-12 Thread Michael Vannorsdel
/NSMutableString. I have found the selectedRange method, but can't figure out how to turn the NSArray into an NSString. Any help would be greatly appreciated. Thanks! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

Re: Convert NSArray to NSString

2008-04-12 Thread Ben Lachman
out how to turn the NSArray into an NSString. Any help would be greatly appreciated. Thanks! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa