Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Tutorials > Tutorial Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 09-11-2008, 12:21 PM   #1 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 3
leafeater is on a distinguished road
Question UIWebView Not Working

All,

I'm trying to get through the UIWebView tutorial and everything compiles with no errors but the screen on the emulator is all black. I'm wondering if it has something to do with the Tutorial being done on the beta version of SDK and I'm using the latest. I dont see a Cocoa template so I used the Window-Based Application to start, would this have anything to do with it possibly? I know this is likely a newbie issue but any help would be greatly appreciated.

M
leafeater is offline   Reply With Quote
Old 09-19-2008, 01:51 AM   #2 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 3
Muriele is on a distinguished road
Default Same problem

I have a black screen too, who can help us ?

Thanks
Muriele is offline   Reply With Quote
Old 02-05-2009, 07:41 AM   #3 (permalink)
Registered Member
 
Join Date: Aug 2008
Posts: 13
amit is on a distinguished road
Unhappy

Hey, whats the problem in UIWebView?? Not able to understand. Everything compiles but no avail.
amit is offline   Reply With Quote
Old 02-05-2009, 06:09 PM   #4 (permalink)
Tutorial Author
 
Join Date: Jan 2009
Posts: 144
meowmix23F is on a distinguished road
Default

First, You should use a "VIEW" based template. This provides a view that is already set up for you. Then it is as simple as dragging on a web view, and then creating an outlet for it in your view controller's subclass.
meowmix23F is offline   Reply With Quote
Old 02-08-2009, 11:39 PM   #5 (permalink)
Registered Member
 
Join Date: Aug 2008
Posts: 13
amit is on a distinguished road
Default Please see code and tell me the problem

- (void)loadView {
// The base view for this view controller
UIView *contentView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
contentView.backgroundColor = [UIColor whiteColor];

// important for view orientation rotation
contentView.autoresizesSubviews = YES;
contentView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
self.view = contentView;

[contentView release];

CGRect webFrame = [[UIScreen mainScreen] applicationFrame];
webFrame.origin.y += 5 + 5.0; // leave from the URL input field and its label
webFrame.size.height -= 40.0;
myWebView = [[UIWebView alloc] initWithFrame:contentView.bounds];
myWebView.backgroundColor = [UIColor whiteColor];
myWebView.scalesPageToFit = YES;
myWebView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
myWebView.delegate = self;
[self.view addSubview: myWebView];


[myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.co.in"]]];

}

#pragma mark UIWebView delegate methods

- (void)webViewDidStartLoad: (UIWebView *)webView
{
// starting the load, show the activity indicator in the status bar
[UIApplication sharedApplication].isNetworkActivityIndicatorVisible = YES;

NSLog(@"Yes started");
}

- (void)webViewDidFinishLoad: (UIWebView *)webView
{
NSLog(@"Yes finished");
// finished loading, hide the activity indicator in the status bar
[UIApplication sharedApplication].isNetworkActivityIndicatorVisible = NO;

}

Everything is compiling and but finally when run, it goes to the 'webViewDidStartLoad' but waits there endlessly for 'webViewDidFinishLoad'..
amit is offline   Reply With Quote
Old 10-13-2009, 02:20 AM   #6 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 69
truehybridx is on a distinguished road
Default

im doing something a lil more complex that involves a view with buttons that opens a view with a webview, the webview loads the correct site but the indicators still dont work

Last edited by truehybridx; 10-13-2009 at 02:32 AM.
truehybridx is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 175,696
Threads: 94,139
Posts: 402,959
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jasper_muc
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:54 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0