New to mobile apps but not new to programming...ran into first significant problem as stated in the title.
Loading the project into the simulator
- app begins to appear (in other words the screen looks as I expect)
- no web page appears
- app disappears (without action by me) and the empty simulator 'desktop' appears with Safari and Photos icons, as well as the icon for UsingViews2
UsingViews2ViewController.h
---------------------------------
Code:
#import <UIKit/UIKit.h>
@interface UsingViews2ViewController : UIViewController {
IBOutlet UIWebView *webView;
}
@property (nonatomic, retain) UIWebView *webView;
@end
UsingViews2ViewController.m
---------------------------------
Code:
#import "UsingViews2ViewController.h"
@implementation UsingViews2ViewController
@synthesize webView;
- (void) viewDidLoad {
NSURL *url = [NSURL URLWithString:@"http://www.apple.com"];
NSURLRequest *req = [NSURLRequest requestWithURL:url];
[webView loadRequest:req];
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[webView release];
[super dealloc];
}
@end
- UIWebView placed in the View
- webView connected to the UIWebView via ctrl-click and drag 'File's Owner' to View-UIWebView and selecting webView
Any ideas?
Thx