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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:12:38+00:00 2026-05-13T16:12:38+00:00

This time, I was wondering when I was supposed to set my properties …

  • 0

This time, I was wondering when I was supposed to set my properties …

I got a nav bar which I use to push a new controller (controlling a Web View) :

NewsViewController *webViewController = [[NewsViewController alloc] init]; // I create my controller

webViewController.urlText = @"http://www.google.fr"; // I set the property

InfonulAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; 

[delegate.newsNavController pushViewController:webViewController animated:YES];

[webViewController release];

I don’t know why but the code below doesn’t work :

- (void)viewDidLoad { //viewDidLoad from my webViewController

   [super viewDidLoad];

   //Create a URL object.
   NSURL *url = [NSURL URLWithString:urlText];
   //URL Requst Object
   NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

   //Load the request in the UIWebView.
   [webView loadRequest:requestObj];
}

I just want to create a UIWebView but I need to give the controller the URL to use !

Any idea where and when my urlText property needs to be set ?!?

Cheers,

Gauthier

  • 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-13T16:12:38+00:00Added an answer on May 13, 2026 at 4:12 pm

    Do you use property correctly? Like

    @property(nonatomic,retain) NSString *urlText;
    

    If so, try to use a customized init method like this;

    -(id)initWithUrl:(NSString *)url
    {
         if(self = [super init])
         {
              self.urlText = url;
    
         }
         return self;
    }
    

    dont forget to release urlText in dealloc. Now use;

    NewsViewController *webViewController = [[NewsViewController alloc] initWithUrl:@"someUrl"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the joda-time-2.0 version library, I was wondering, which of this functions is better
I've been wondering about this problem for some time - doubleclicking a winforms TabControl's
This time I have an error which I have been trying again to figure
I am installing Hunchentoot on a new machine. This time I thought I would
This is a question I was wondering about for some time now, but couldn't
this time it's about Ruby On Rails. I have a form in the view
this time i have a simple question: I have one table, related with himself
At this time Textmate's official Python bundle is really bare bones, especially in comparison
Ok this time I decided to make a list using the STL. I need
I really need help this time - Joomla 2.5 and latest K2. I'm using

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.