Brand new to app coding-- hope you can help!
I'm using XCode 4.3 with Storyboard.
I have a UIWebView inside a tabbed UIview that loads an .mp3 file and plays it when that tab is selected. What I'd like, however, is to have the WebView sit idle when the tab is displayed, then only load once the user has pressed a "Load" button.
(Also, I've linked the "Load" button already as a Reload in Storyboard, so I guess I really would just like to know how to make UIWebView not load the first time?)
Here is my code atm:
@implementation FirstViewController
@synthesize webView;
- (void)viewDidLoad
{
[super viewDidLoad];
[webView loadRequest:[NSURLRequest
requestWithURL:[NSURL URLWithString:
@"http://mysite.com/test.mp3"]]]
;
// Do any additional setup after loading the view, typically from a nib.
}
- (void)viewDidUnload
{
webView = nil;
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
@end
Thanks so much for any help!