Re: UTI for Mach-O file

2010-08-25 Thread John Johnson
>> I guess that makes sense. But then why is there a com.apple.mach-o.binary >> and a public.unix-executable UTI in the first place?? > > Well, technically, UTIs are not just applied to on-disk files. They can be > applied to email attachments, where a MIME type might give that sort of > infor

UTI for Mach-O file

2010-08-25 Thread John Johnson
Hello. I'm implementing an NSDocument-based utility that loads mach-o files and displays information about them. But no matter what UTI I put in the Info.plist, I can't get the app to recognize the file when dropped on the dock tile. The only way I could get it recognized is by having no UTI and

Re: Set Hierarchical NSUserDefaults Value

2010-07-16 Thread John Johnson
> or use something like this category I wrote last year, when I got tired of > uprooting and replanting entire trees in my User Defaults, every time I > wanted to change a leaf: > > > Very nice. I think I will find this useful. Thanks. -J___ Coco

Re: Sanity Check

2010-07-08 Thread John Johnson
> I have taken all advice and the code now looks like below which cleans up the > pointed out controller leak and does not store [self window]: There still seems to be some problems with your code... > - (IBAction)sewing:(id)sender { > > [[[SewingController alloc] initWithWindowNibName:@"

Re: Custom bundle icon

2010-07-05 Thread John Johnson
> You can't "set a UTI on something." You provide a UTI declaration in > your Info.plist, consisting of a set of attributes that define what it > means for a file to conform to a UTI, and Launch Services uses that to > match files against when it tries to determine their UTI. So, no, by > definitio

Re: Custom bundle icon

2010-07-05 Thread John Johnson
> You should do as Jean-Daniel says, but also, you should set the 'bundle > bit' of your .ftplugin files. > > The system only knows to show .ftplugin folders as flat files if it can > find your UTI somewhere. If the user has your app, then that's fine, > but if not then he'll still see a folder.

Re: Custom bundle icon

2010-07-02 Thread John Johnson
2010, at 8:39 AM, John Johnson wrote: > Just an aesthetic question. I've implemented an API for cocoa plugins in my > app, and the plugins use a custom extension, ftplugin. These plugins show up > as folders in the finder, even though I've set the app icon to an icns file. &g

Custom bundle icon

2010-07-02 Thread John Johnson
Just an aesthetic question. I've implemented an API for cocoa plugins in my app, and the plugins use a custom extension, ftplugin. These plugins show up as folders in the finder, even though I've set the app icon to an icns file. Is there something particular I have to do to have the plugin trea

Re: DnD International No symbol

2010-06-19 Thread John Johnson
> On Wed, Jun 16, 2010 at 7:19 PM, Tony Romano wrote: >> Hmm... I'm returning the NSDragOperationNone now, all I get is an image of >> what is being dragged no other symbol and the outlineview won't accept the >> drop which is correct. When I have a valid selection, I get the other >> symbol

Re: Problem running CocoaDVDPlayer sample

2010-06-17 Thread John Johnson
> Didn't there used to be a technote on how to circumvent this behavior? > iTunes pulls some of the same trickery. I doubt Apple would build in a way to circumvent this behavior. That would defeat the purpose of having it there in the first place. That said, you can build a kernel extension that

Re: NSButton with image

2010-06-14 Thread John Johnson
> If all I want is an image that acts like a button, do I need to > subclass NSButton? I just want my button to show only my image and no > "Apple" style button backgrounds. All this is easily found in the NSButton and NSButtonCell documentation. I believe what you are looking for is setImagePosi

Re: Spotlight-Style search menu (SOLVED)

2010-06-02 Thread John Johnson
> Well, you can have the custom view in the status bar to be a NSButton, it's > action will compute the location and make the window key and visible at that > location and when the window resigns key, just fade it away Brilliant! Seems the only way to go. Anyhow, thanks for the help :)

Re: Spotlight-Style search menu

2010-06-02 Thread John Johnson
> Currently there is not. You should file an enhancement request at > http://bugreport.apple.com asking for this feature. You're certainly not the > only one who would like it. :) > > --Kyle Sluder Hmm that is slightly disappointing. Another couple of subclasses and dozens of lines of code fo

Re: The Unadopted Protocol

2010-06-02 Thread John Johnson
> This compiles and runs fine, even though MyClass never adopted the protocol > Unadopted. It take it that by casting mc to an id, I cause the compiler to > grasp at the only signature for "testing" that it knows about, namely the > one in the protocol. So it happily uses that signature without co

Spotlight-Style search menu

2010-06-02 Thread John Johnson
So I know how to set a view in an NSMenuItem, but my question is how to get it to look similar to the Spotlight search menu. For example, if I set the first item in a popup menu to a custom view, there is still a thin strip of "white" across the top. I want the gradient from the view to fill up

Re: Question about how to make a custom sheet

2010-05-29 Thread John Johnson
Perhaps NSWindowController subclass is what you're looking for. A sheet is just another window. Then set the File's Owner of the NIB file that houses the sheet to this subclass. > My problem is how to get a custom class attached to the sheet, so controls on > the sheet can be controlled during

Re: reformat drive to HFS via API

2010-05-25 Thread John Johnson
The DiskManagement.framework is a private framework. Short of creating your own API using low-level disk access, diskutil may be your best bet. > I would like to be able to reformat a flash drive from control application, > but it appears that there is no public API that allows this kind access.