Kevin Walzer wrote:

Answers my own question: put the call in switchIcon, before calling anything else in that method. cf:


Errr, that method should be as follows:

-(int) switchIcon: (NSString *) iconPath  {
        
        NSApplicationLoad();
        
        //set up autorelease pool
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
        
      //convert file path to URL
     iconURL = [[NSURL alloc] initFileURLWithPath: iconPath];

    //create image from URL
     newIcon = [[NSImage alloc] initWithContentsOfURL: iconURL];

        //set the new icon
     [NSApp setApplicationIconImage: newIcon];


    //release the memory
     [newIcon release];
         [iconURL release];
        
         [pool release];                



        return 0;
}



--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to