Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6009223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:56:23+00:00 2026-05-23T01:56:23+00:00

I am working on a app that reads RSS feeds and picks out the

  • 0

I am working on a app that reads RSS feeds and picks out the specific media. After that the user will be directed to a web view that plays the selected media. I already have the web view built and I can access the URL. I can also open the file in Safari, but I need ti to open within the app. What I have so far is listed below.

I need help pushing the media to the web view. Thank you for your help!

if (indexPath.section == SectionHeader && indexPath.row == SectionHeaderEnclosure) {  
    if (item.enclosures) {  
        for (NSDictionary *dict in item.enclosures){  
            NSString *url = [dict objectForKey:@"url"];  
            NSLog(@" url is : %@",url);  
            //EXPERIMENTAL

            [teachings loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
            self.title = item.title;

            //[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
        }  
    }  
}

EDIT: The .m is below

#import "DetailTableViewController.h"
#import "NSString+HTML.h"

typedef enum { SectionHeader, SectionDetail } Sections;
typedef enum { SectionHeaderTitle, SectionHeaderDate, SectionHeaderURL, SectionHeaderEnclosure } HeaderRows;
typedef enum { SectionDetailSummary } DetailRows;

@implementation DetailTableViewController

@synthesize item, dateString, summaryString, teachings;

#pragma mark -
#pragma mark Initialization
- (id)initWithStyle:(UITableViewStyle)style {
if ((self = [super initWithStyle:style])) {

}
return self;
}

#pragma mark -
#pragma mark View lifecycle

- (void)viewDidLoad {

// Super
[super viewDidLoad];

// Date
if (item.date) {
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateStyle:NSDateFormatterMediumStyle];
    [formatter setTimeStyle:NSDateFormatterMediumStyle];
    self.dateString = [formatter stringFromDate:item.date];
    [formatter release];
}

// Summary
if (item.summary) {
    self.summaryString = [item.summary stringByConvertingHTMLToPlainText];
} else {
    self.summaryString = @"[No Summary]";
}

}

#pragma mark -
#pragma mark Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 2;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
switch (section) {
    case 0: return 4;
    default: return 1;
}
}

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

// Get cell
static NSString *CellIdentifier = @"CellA";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
}

// Display
cell.textLabel.textColor = [UIColor blackColor];
cell.textLabel.font = [UIFont systemFontOfSize:15];
if (item) {

    // Item Info
    NSString *itemTitle = item.title ? [item.title stringByConvertingHTMLToPlainText] : @"[No Title]";

    // Display
    switch (indexPath.section) {
        case SectionHeader: {

            // Header
            switch (indexPath.row) {
                case SectionHeaderTitle:
                    cell.textLabel.font = [UIFont boldSystemFontOfSize:15];
                    cell.textLabel.text = itemTitle;
                    break;
                case SectionHeaderDate:
                    cell.textLabel.text = dateString ? dateString : @"[No Date]";
                    break;
                case SectionHeaderURL:
                    cell.textLabel.text = item.link ? item.link : @"[No Link]";
                    cell.textLabel.textColor = [UIColor blueColor];
                    cell.selectionStyle = UITableViewCellSelectionStyleBlue;
                    break;
                case SectionHeaderEnclosure:
                    cell.textLabel.text = item.link ? item.link : @"[No Link]";
                    cell.textLabel.textColor = [UIColor blueColor];
                    cell.selectionStyle = UITableViewCellSelectionStyleBlue;
                    break;
            }
            break;

        }
        case SectionDetail: {

            // Summary
            cell.textLabel.text = summaryString;
            cell.textLabel.numberOfLines = 0; // Multiline
            break;

        }
    }
}

return cell;

}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == SectionHeader) {

    // Regular
    return 34;

} else {

    // Get height of summary
    NSString *summary = @"[No Summary]";
    if (summaryString) summary = summaryString;
    CGSize s = [summary sizeWithFont:[UIFont systemFontOfSize:15] 
                   constrainedToSize:CGSizeMake(self.view.bounds.size.width - 40, MAXFLOAT)  // - 40 For cell padding
                       lineBreakMode:UILineBreakModeWordWrap];
    return s.height + 16; // Add padding

}
}

#pragma mark -
#pragma mark Table view delegate

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

// Open URL
if (indexPath.section == SectionHeader && indexPath.row == SectionHeaderURL) {
    if (item.link) {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:item.link]];
    }
}

if (indexPath.section == SectionHeader && indexPath.row == SectionHeaderEnclosure) {  
    if (item.enclosures) {  
        for (NSDictionary *dict in item.enclosures){  
            NSString *url = [dict objectForKey:@"url"];  
            NSLog(@" url is : %@",url);  
            //EXPERIMENTAL

            UIWebView *urlView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; 
            [self.view addSubView:urlView]; 
            [urlView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];

            //[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
        }  
    }  
} 

// Deselect
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];

}


#pragma mark -
#pragma mark Memory management

- (void)dealloc {
[dateString release];
[summaryString release];
[item release];
[teachings release];
[super dealloc];
}


@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:56:24+00:00Added an answer on May 23, 2026 at 1:56 am

    Launch it from UIWebView , not in Safari. Here is an example implementation:

    /* WebViewController that is responsible for displaying webview (shown modally) */
    
    @interface WebViewController:UIViewController
    {
        NSString *_url;
        UIWebView *webView;
    }
    @end
    
    @implementation WebViewController
    {
    
     -(void) backClicked
      {
          [self dismissModalViewControllerAnimated:YES];
      }
     -(id) initWithURL:(NSString*)url
    {
        if(self = [super init])
        {
           _url = url;
        }
        return self;
    }
    - (void)loadView 
    {
        self.view = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,480)]; 
        webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 400)];
        UIButton *backButton = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
        [backButton addTarget:self action:@selector(backClicked) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubView:webView];
        [self.view addSubView:but];
        [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:_url]]];
    }
    
    }
    @end   
    

    In your code (import WebViewController to your source file).

    ....
    NSLog(@" url is : %@",url);  
    //EXPERIMENTAL
    
    WebViewController *webVC = [WebViewController alloc] initWithURL:url];
    [self presentModalViewController:webVC animated:YES];
    ....
    

    Note:i implemented only the required methods.
    let me know if this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that reads RSS feeds, is working fine, but I would
I'm working on a web app that reads data from a set of text
I did a program that reads rss news feeds. Its not working for some
I'm working on an app that needs to accept a RegEx from the user,
I'm working on an app that will be using https, but we wanted to
I'm working on a Grails web app that would be similar in access patterns
Have an app written that automatically reads out received text messages when they arrive.
I'm working on an android app that writes and reads .PNG files from sdcard.
I`m working on an app that does reading and handling specific URIs from NFC
I've been developing an app that reads a .csv file, takes out approximately 16

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.