Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Blakeasd

macrumors 6502a
Original poster
Dec 29, 2009
643
0
I have this program that checks if Chrome is installed on your computer. If it is not installed it will make a button on the main interface not visible. Where do I put the method that does this so it is triggered on startup? Here is my code:
Code:
-(IBAction)doesChromeExist:(id)sender{
	NSString *chromePathName = [@"/Users/" stringByAppendingString:NSUserName()];
	chromePathName = [chromePathName stringByAppendingString:@"/Applications/Chrome.app"];
	NSFileManager *manager;
	manager = [NSFileManager defaultManager];
	if([manager fileExistsAtPath:chromePathName]==YES){
		[clearChromeCache setTransparent:TRUE];	}

}
Thanks in advance!
 
Before my program even shows the main window, I want this code to be run:
Code:
-(IBAction)doesChromeExist:(id)sender{
	NSString *chromePathName = [@"/Users/" stringByAppendingString:NSUserName()];
	chromePathName = [chromePathName stringByAppendingString:@"/Applications/Chrome.app"];
	NSFileManager *manager;
	manager = [NSFileManager defaultManager];
	if([manager fileExistsAtPath:chromePathName]==YES){
		[clearChromeCache setTransparent:TRUE];	}

}
How do I achieve this?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.