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

I've been wondering this for some time. As the title say, which is faster,
I saw this keyword for the first time and I was wondering if someone
I've got a reasonably simple query (this time) that I need ALL the results
I am starting a new web application in PHP and this time around I
I've got this date time string: post[date] = 2007-07-18 10:03:19 I'd like to extract
I am installing Hunchentoot on a new machine. This time I thought I would
Easy question this time. I'm trying to test whether or not a string does
This is similar to my previous posting. But this time I want to call
I'm always surprised that even after using C# for all this time now, I
I have been building enterprise software for the last 10 years. In this time

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.