• 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: Multiple instances of NSApp/NSApplicationLoad()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple instances of NSApp/NSApplicationLoad()


  • Subject: Re: Multiple instances of NSApp/NSApplicationLoad()
  • From: Kevin Walzer <email@hidden>
  • Date: Tue, 17 Feb 2009 10:04:26 -0500
  • Organization: WordTech Communications LLC

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@hidden)

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:
This email sent to email@hidden


References: 
 >Multiple instances of NSApp/NSApplicationLoad() (From: Kevin Walzer <email@hidden>)
 >Re: Multiple instances of NSApp/NSApplicationLoad() (From: Kevin Walzer <email@hidden>)

  • Prev by Date: Re: Multiple instances of NSApp/NSApplicationLoad()
  • Next by Date: Re: At what point during loading can NSPersistentDocument fetch?
  • Previous by thread: Re: Multiple instances of NSApp/NSApplicationLoad()
  • Next by thread: Attempting to get distinct values from an entity's attribute
  • Index(es):
    • Date
    • Thread