Deal of the Day

Home » Main » Manning Forums » 2008 » iPhone in Action

Thread: Chapter 20: RSS Reader URL Don't Load in UIWebView

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 1 - Pages: 1 - Last Post: Jun 26, 2009 3:13 PM by: shannon.appelcl...

Posts: 1
From: Silicon Valley, CA, USA
Registered: 6/26/09
Chapter 20: RSS Reader URL Don't Load in UIWebView
Posted: Jun 26, 2009 11:27 AM
  Click to reply to this thread Reply

I am working with the RSS Reader example from Chapter 20, using articles loaded from the Apple Hot News feed

Some URL open in the UIWebView, but others don't (tested in simulator and on device) and I don't see the difference. All open fine in Safari on my desktop. They also will open in a browser or the iTunes Music Store on a device, if I hard code them into an app and use something like:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@""]];
Title: Download iTunes U programming directly to your iPhone
Title: Apple sells more than a million iPhone 3GS models
Title: iPhone 3G S the “best all-around smartphone available”

Title: Keeping Earth out of harm’s way
(opens iTunes Store on device, shows "Contacting iTunes U..." on simulator.)
Title: App Store Pick of the Week: At Bat 2009
(On the device this should open the App Store. I know from experience that the device seems to want URL formatted as "itms://" or "" in order to launch the iTunes music store, but these seem to be working as-is when hard-coded.)

I'd really appreciate it if someone can tell me why some URL don't work, and what I need to do to fix this. Thanks.


Posts: 55
Registered: 5/29/08
Re: Chapter 20: RSS Reader URL Don't Load in UIWebView
Posted: Jun 26, 2009 3:13 PM   in response to: DenVog in response to: DenVog
  Click to reply to this thread Reply

Re: Apple sells more than a million ...

If you look, you'll see the URL being given for this entry is formatted incorrectly, with two ?s:

Re: The best all-around smartphone:
If you're patient, this one will load, just very slowly

I don't know about the funky Apple store URL, but I suspect it's also got some minor glitch that prevents a bare UIWebView from loading it.

For a live app, you'd probably want to spend some time testing the URLs (unless you *know* you can trust them) and you'd also likely want to show a loading icons to let people know stuff is going on and to fail gracefully if a URL fails to load altogether. (For one example of the latter, see pp.403-405).

Gold: 300 + pts
Silver: 100 - 299 pts
Bronze: 25 - 99 pts
Manning Author
Manning Staff
Manning Developmental Editor