Guest User

Untitled

a guest
May 20th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  2. // Navigation logic
  3. if(indexPath.row == 0 && indexPath.section == 2){
  4. NSString * storyLink = [currentStory objectForKey: @"link"];
  5.  
  6. // clean up the link - get rid of spaces, returns, and tabs...
  7. storyLink = [storyLink stringByReplacingOccurrencesOfString:@" " withString:@""];
  8. storyLink = [storyLink stringByReplacingOccurrencesOfString:@"n" withString:@""];
  9. storyLink = [storyLink stringByReplacingOccurrencesOfString:@" " withString:@""];
  10.  
  11. // NSLog(@"link: %@", storyLink);
  12. // open in Safari
  13. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:storyLink]];
  14. }
Add Comment
Please, Sign In to add comment