Using Cocoa to create an icon for a folder?

The NSWorkspace method works like a charm here. Maybe your icon is in an invalid format? I tried setIcon: using the Finder icon.

The NSWorkspace method works like a charm here. Maybe your icon is in an invalid format? I tried setIcon: using the Finder icon: - (IBAction)setFolderIcon:(id)sender { NSOpenPanel* openPanel = NSOpenPanel openPanel; openPanel setCanChooseFiles:NO; openPanel setCanChooseDirectories:YES; switch(openPanel runModal) { case NSFileHandlingPanelOKButton: { NSURL* directoryURL = openPanel directoryURL; NSImage* iconImage = NSImage alloc initWithContentsOfFile:@"/System/Library/CoreServices/Finder.

App/Contents/Resources/Finder. Icns"; BOOL didSetIcon = NSWorkspace sharedWorkspace setIcon:iconImage forFile:directoryURL path options:0; NSLog(@"%d", didSetIcon); iconImage release; } case NSFileHandlingPanelCancelButton: { return; } } }.

Don't forget to release the NSImage instance (assuming you are not using GC). – Peter Hosey Apr 21 at 8:10 Thanks Peter. Updated answer.

– weichsel Apr 21 at 8:20.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions