How do I get my program to open a webpage in the default browser when a button is clicked? Thanks! Nate
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.apple.com"]]
BOOL appOpened = [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.apple.com"]];
if(appOpened) {
NSLog(@"Enjoy your page!");
} else {
NSLog(@"Couldn't find an appropriate application to display a web page.");
}
My simple understanding of methods and functions is that methods are "actions" and functions are "commands". I don't understand "void" methods. I use "IBActions" and functions to do what I want to do. Maybe I should hold off on learning that stuff because I'm not ready or maybe I should get it over with. I don't know. Thanks a lot for your help guys I really appreciate it