1 Replies - 1689 Views - Last Post: 29 June 2011 - 08:51 AM

#1 Tyre77  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 28-May 11

Opening a Link from RSS reader in Safari

Posted 28 June 2011 - 09:09 AM

I'm making a basic RSS reader and it should be opening the link in Safari, but nothing happens when I click on the cell. Here is what I have:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//Navigation Logic:

int storyIndex = [indexPath indexAtPosition: [indexPath length] -1];
NSString *storyLink = [[stories objectAtIndex: storyIndex] objectForKey:@"link"];

//cleaning up the link...

storyLink = [storyLink stringByReplacingOccurrencesOfString:@" " withString:@""];
storyLink = [storyLink stringByReplacingOccurrencesOfString:@"/n" withString:@""];
storyLink = [storyLink stringByReplacingOccurrencesOfString:@"  " withString:@""];

NSLog(@"link: %@", storyLink);

//open in Safari
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:storyLink]];


}



Here is what shows up in the log:

2011-06-27 20:03:51.817 ParadiseBeats[26927:207] all done
2011-06-27 20:03:51.818 ParadiseBeats[26927:207] stories array had 20 items
2011-06-27 20:03:53.758 ParadiseBeats[26927:207] link: technobuffalo.com/companies/apple/


But the link isn't actually opening in Safari. Thoughts?

Is This A Good Question/Topic? 0
  • +

Replies To: Opening a Link from RSS reader in Safari

#2 GWatt  Icon User is online

  • member icon

Reputation: 276
  • View blog
  • Posts: 3,075
  • Joined: 01-December 05

Re: Opening a Link from RSS reader in Safari

Posted 29 June 2011 - 08:51 AM

Did you check the return value of openURL? (YES|NO) My first thought is that another application is intercepting the open request and then not doing anything.
Looking at your log message I see that the URL does not appear to have a protocol specified. If that's the case you might want to manually attach the correct protocol as that will likely affect what application opens the URL.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1