Re: Handling UTIs from a Cocoa protocol

2011-12-17 Thread Ken Thomases
On Dec 17, 2011, at 11:13 PM, Charles Srstka wrote: > Chris already answered your main question, but I’d just like to add that it’s > probably better to use UTTypeConformsTo() instead of UTTypeEqual() to test > UTIs. This way, in the hypothetical case that you encounter a subtype of one > of th

Re: Handling UTIs from a Cocoa protocol

2011-12-17 Thread Charles Srstka
On Dec 17, 2011, at 8:02 PM, C.W. Betts wrote: > This is how I have my code set up: an Objective-C protocol that has a class > function that returns an NSArray of UTIs that it can handle, and a member > function that handles the file type: > > @protocol PcsxrFileHandle > > + (NSArray *)utisCa

Re: Handling UTIs from a Cocoa protocol

2011-12-17 Thread Chris Hanson
On Dec 17, 2011, at 6:02 PM, C.W. Betts wrote: > Is there a way to put classes into some sort of array to go through and check > if the UTI of a file matches up to any of the UTIs that the class can handle? Classes are objects too, so you can put them in arrays and so on. -- Chris __

Handling UTIs from a Cocoa protocol

2011-12-17 Thread C.W. Betts
This is how I have my code set up: an Objective-C protocol that has a class function that returns an NSArray of UTIs that it can handle, and a member function that handles the file type: @protocol PcsxrFileHandle + (NSArray *)utisCanHandle; - (BOOL)handleFile:(NSString *)theFile; @end Howeve

Re: Sheet created by NSObjectContoller??

2011-12-17 Thread Robert Monaghan
Oops, missed the number formatter.. You are right.. number formatter is needed for the min/max values to show up. Which makes me thing that this is a mechanism that is a part of the number formatter. Will dig around there. Will post a note if I find anything. bob. On Dec 17, 2011, at 2:43 PM,

Re: Sheet created by NSObjectContoller??

2011-12-17 Thread Peter
Thanks for the info! I never realized that this is possible with object controllers. But wait a minute: While playing around with this mechanism, it turns out that you have a number formatter installed on the text field for this to work. I realized this when my app crashed after I had removed th

Re: Using Spotlight to query external source

2011-12-17 Thread Jens Alfke
On Dec 17, 2011, at 3:13 AM, Alexander Reichstadt wrote: > reading through the spotlight docu I am not sure where to start or if the > following is possible. I am trying to find out if a spotlight importer can be > used to query external data sources. I know the advantage of spotlight is > mea

Re: Sheet created by NSObjectContoller??

2011-12-17 Thread Robert Monaghan
The binding is straight forward.. You create an NSObjectController, and set the "Mode" to "Class" and the Class Name to your object with a bunch of NSNumbers. (prepared with @property/@synthesize, naturally) In my NSTextField, I bind my "value", "Min Value" and "Max Value" to the NSObjectContr

Re: Sheet created by NSObjectContoller??

2011-12-17 Thread Peter
Am 17.12.2011 um 19:59 schrieb Robert Monaghan: > Hi Everyone, > > Perhaps someone can help point me in the right direction on this: > > I have an NSObjectController that maintains a UI for me. > I have an NSTextField which contains numerical value. You could type in a > number, which populate

Re: responding to NSStepper clicks

2011-12-17 Thread Peter
Here is a simple tutorial by a list member of ours: http://juliuspaintings.co.uk/cgi-bin/paint_css/animatedPaint/059-NSStepper-NSTextField.pl This example uses an object controller but can be reconfigured to bypass it and bind to an ivar easily. Even though it uses a number formatter besides th

Sheet created by NSObjectContoller??

2011-12-17 Thread Robert Monaghan
Hi Everyone, Perhaps someone can help point me in the right direction on this: I have an NSObjectController that maintains a UI for me. I have an NSTextField which contains numerical value. You could type in a number, which populates an NSNumber object deep inside my code.. Magically, my NSObjec

Re: responding to NSStepper clicks

2011-12-17 Thread Koen van der Drift
On Dec 16, 2011, at 11:48 PM, Quincey Morris wrote: > There are various solutions you might choose, depending on how you expect to > handle validation errors for your text field. You can add a number formatter > to the field, or you can change the property to type long long (though you > then

Using Spotlight to query external source

2011-12-17 Thread Alexander Reichstadt
Hi, reading through the spotlight docu I am not sure where to start or if the following is possible. I am trying to find out if a spotlight importer can be used to query external data sources. I know the advantage of spotlight is meant to pre-catalog files in order to quickly return results. Bu