#import "SampleApp.h" @implementation SampleApp - (void) applicationDidFinishLaunching: (id) unused { NSString *basepath, *urlstring; NSURL *baseurl; NSError *error; // locate url.txt, the file that stores the URL to open basepath = [[NSBundle mainBundle] pathForResource:@"url" ofType:@"txt" inDirectory:@"/"]; // read in the url string to open urlstring = [[NSString stringWithContentsOfFile:basepath encoding:1 error: error] stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; // create a url with that string and open it baseurl = [[NSURL alloc] initFileURLWithPath:urlstring]; [self openURL:baseurl]; } @end