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

The Archive Base Latest Questions

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

I created a instance of my ViewController(TimeLineViewController), which will be presented. This ViewController contains

  • 0

I created a instance of my ViewController(TimeLineViewController), which will be presented. This ViewController contains a UITableView, which gets the cells from a instance of my TableViewCell. So the ViewController creates an instance of the TableCellView.
The TableViewCell contains a UITextView with enabled weblinks. Now I want to disable the function that safari opens. I did a subclass of the UITextView and:

- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id < WebPolicyDecisionListener >)listener
{   NSLog(@"request: %@", request); //Console shows the link
}

Now I want that with a click on the weblink a new ViewController(WebViewController) appears. The problem is that the TableViewCell can´t “open” a new ViewController. So I tried this:
In the TableViewCell:

- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id < WebPolicyDecisionListener >)listener
{   NSLog(@"request: %@", request);
    TimeLineViewController * web = [[TimeLineViewController alloc]init];
    [web loadView];
}

And in the ViewController:

- (void)loadWeb{
    WebViewController *lust = [[WebViewController alloc] initWithNibName:nil bundle:nil];
    lust.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:lust animated:YES];
    [lust release];
}

The problem is that he always just reload the TimeLineViewController, but doesn’t load the WebViewController. Why? How can I fix it?
(I know that the WebViewController doesn’t get the weblink in my posted code and I know how to do it. That shouldn’t be the problem, when I know, how to fix my problem.)

Thanks for your help! If you have questions, just ask – Sorry for my bad English.

UPDATE:
I did what Frank mention, but I doesn’t work. I created a WebViewTableCellDelegate.h with:

@protocol WebViewTableCellDelegate
-(void)loadWeb;
@end

Then I created a instance variable of the WebViewDelegate in the TableViewCell:

__weak NSObject <WebViewTableCellDelegate> *_delegate;

and in the .m:

@interface UITextView (Override)
@end

@class WebView, WebFrame;
@protocol WebPolicyDecisionListener;

@implementation UITextView (Override)

- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id < WebPolicyDecisionListener >)listener
{   NSLog(@"request: %@", request);
    [_delegate loadWeb];
}

@end

In my TimeLineViewController I implemented the WebViewTableCellDelegate with <> and in the line, where I create the cells, I set the owner to self:

  TableViewCell *cell = (TableViewCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
    if(cell == nil) {
        [[NSBundle mainBundle] loadNibNamed:@"TableViewCell" owner:self options:nil];
        cell = tableCell;
    }

Why doens´t it work? There is no error-warning.

  • 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-13T15:04:58+00:00Added an answer on May 13, 2026 at 3:04 pm

    I would do the following:

    1. Create a WebViewTableCellDelegate protocol (look up how to create a protocol on Apple’s site). The protocol should include your loadWeb: method.
    2. Have your TimeLineViewController implement the protocol and give your UITextView subclass an instance variable of type <WebViewTableCellDelegate>.
    3. When you’re creating the table view cell, set it’s delegate to self (the TimeLineViewController).
    4. When someone taps a link, call [delegate loadWeb:request]
    5. Have your loadWeb: method accept an NSURLRequest and load it into the web view.

    That should do the trick.

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

Sidebar

Ask A Question

Stats

  • Questions 375k
  • Answers 375k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you using Resharper? If you're using Resharper you can… May 14, 2026 at 8:07 pm
  • Editorial Team
    Editorial Team added an answer getSharedPreferences(), should you choose to use it, is only available… May 14, 2026 at 8:07 pm
  • Editorial Team
    Editorial Team added an answer The .lib file you linked is not what you think… May 14, 2026 at 8:07 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.