• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: trouble in setting the custom icon which view in the Finder.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trouble in setting the custom icon which view in the Finder.


  • Subject: Re: trouble in setting the custom icon which view in the Finder.
  • From: John Stiles <email@hidden>
  • Date: Thu, 17 Feb 2005 10:32:27 -0800

But remember, any Carbon code not written by Apple is immediately suspect and should never be used. If Cocoa can't do it, obviously it wasn't meant to be done.
(Sorry, don't take it personally—I'm just a little sick of the Cocoa elitism in general…)


On Feb 17, 2005, at 2:38 AM, Douglas Norton wrote:

Tim,

You need to send the Finder a sync AppleEvent.

Take a look at <http://developer.apple.com/samplecode/SetCustomIcon/SetCustomIcon.html>.

I know it a Carbon example, but it is Apple sample code so can be relied upon.

Douglas


On 17 Feb 2005, at 08:43, Tim.xgxu wrote:

Hello
    I meet trouble in setting the custom icon in file. When I use setIcon method to set the file's icon, I find it won't really act. when I reopen in Finder, the icon still is older, not changed. the follows are the code:


 NSFileWrapper * pfw = [[NSFileWrapper alloc] initWithPath: @"~/tmp.file"];
 NSImage * pimg = [[NSImage alloc] initByReferencingFile: @"~/file.tif"];
 [pfw setIcon: pimg];
// tmp.file is the file that I want to change the icon in Finder
//the file.tif is the file that store the icon.
 
Is it mean that I didn't do something more?
 
thanks in advance for anyone who give any suggestions. Thanks.
 
all the best
Tim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >trouble in setting the custom icon which view in the Finder. (From: "Tim.xgxu" <email@hidden>)
 >Re: trouble in setting the custom icon which view in the Finder. (From: Douglas Norton <email@hidden>)

  • Prev by Date: RSS/RDF
  • Next by Date: Bug tracker suggestion.
  • Previous by thread: Re: trouble in setting the custom icon which view in the Finder.
  • Next by thread: Pushing Bindings to Far?
  • Index(es):
    • Date
    • Thread