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 903375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:52:04+00:00 2026-05-15T15:52:04+00:00

ok rather than try to explain my problem in text, watch this little video

  • 0

ok rather than try to explain my problem in text, watch this little video i recorded
http://www.youtube.com/watch?v=fwb55jnZI6w

and here is the code for the detail view controller (the page where the webview is)

detailViewController.h

#import <UIKit/UIKit.h>
#import "MWFeedItem.h"
@interface DetailViewController : UIViewController <UIWebViewDelegate>  {
    MWFeedItem *item;
    NSString *summaryString;
    IBOutlet UILabel *titleLabel;
    IBOutlet UIWebView *contentLabel;
    //IBOutlet UILabel *dateLabel;
    IBOutlet UIScrollView *textScroller;
}
@property (nonatomic, retain) MWFeedItem *item;
@property (nonatomic, retain) NSString *summaryString;
@property (nonatomic, retain) IBOutlet UILabel *titleLabel;
@property (nonatomic, retain) IBOutlet UIWebView *contentLabel;
@end

detailViewController.m

    #import "DetailViewController.h"
#import "NSString+XMLEntities.h"

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



@implementation DetailViewController
@synthesize item, summaryString, titleLabel, contentLabel;


- (BOOL)webView:(UIWebView *)contentLabel shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; {

    NSURL *requestURL = [ [ request URL ] retain ];
    // Check to see what protocol/scheme the requested URL is.

        return [ [ UIApplication sharedApplication ] openURL: [ requestURL autorelease ] ];
    return NO;
    // Auto release
    [ requestURL release ];
    // If request url is something other than http or https it will open
    // in UIWebView. You could also check for the other following
    // protocols: tel, mailto and sms
}
- (void)viewDidLoad {

    [super viewDidLoad];

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

    if (item.summary) {
        self.summaryString = [[[item.summary stringByStrippingTags] stringByRemovingNewLinesAndWhitespace] stringByDecodingXMLEntities];
    }

        titleLabel.text = item.title ? item.title : @"[No Title]";
        [titleLabel setBackgroundColor:[UIColor clearColor]];
        //dateLabel.text = dateString ? dateString : @"[No Date]";
                            // Summary
    NSString *HTMLData = summaryString;
    [contentLabel loadHTMLString:HTMLData baseURL:[NSURL URLWithString: [NSString stringWithFormat:@"http://www.feed43.com/1515171705611023.xml"]]];

    //Calculate the expected size based on the font and linebreak mode of your label
    //CGSize maximumLabelSize = CGSizeMake(280,9999);

    //CGSize expectedLabelSize = [summaryString sizeWithFont:contentLabel.font 
    //constrainedToSize:maximumLabelSize 
    //lineBreakMode:contentLabel.lineBreakMode]; 


    //adjust the label the the new height.
    //CGRect newFrame = contentLabel.frame;
    //newFrame.size.height = expectedLabelSize.height;
    //contentLabel.frame = newFrame;
    [textScroller setCanCancelContentTouches:NO];
    [textScroller setContentSize:CGSizeMake(320, 500)];
    textScroller.indicatorStyle = UIScrollViewIndicatorStyleBlack;
    textScroller.scrollEnabled = YES;
    textScroller.clipsToBounds = YES;

    //return titleLabel;
    //return dateLabel;
    //return contentLabel;

}
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    //return (interfaceOrientation == UIInterfaceOrientationPortrait);
    return NO;
}
- (void)dealloc {
    [super dealloc];
}
@end

note: even though it says “contentLabel” it is a UIWebView. it is left over from old versions

Thanks!

  • 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-15T15:52:05+00:00Added an answer on May 15, 2026 at 3:52 pm

    Implement -(BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
    Then you can do something like this :

    NSURL* url = [request URL];
    if (UIWebViewNavigationTypeLinkClicked == navigationType)
    {
        [[UIApplication sharedApplication] openURL:url];
        return NO;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I adapted this tutorial (http://www.screaming-penguin.com/node/7749) to an Android app I've built to allow for
Try this link on Firefox or Chrome: http://dl.dropbox.com/u/34375299/aaa/index.html Notice a simple animation appears on
Rather than scraping a Ruby version of this algorithm off the net I wanted
Has anyone used Lucene.NET rather than using the full text search that comes with
(This is a question about the UI rather than the technology required to do
Rather than try to reinvent the wheel, I'm hoping someone can shed some light
Rather than population said DOM object with an external page such as HTML CFM
I'm developing an operating system and rather than programming the kernel, I'm designing the
Does creating an object using reflection rather than calling the class constructor result in
Using C# and WPF under .NET (rather than Windows Forms or console), what is

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.