开发者

UIWebView - NSStringWithFormat [closed]

开发者 https://www.devze.com 2023-01-15 01:29 出处:网络
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post.
Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 8 years ago.

Improve this question

I'm trying to get a UIWebView working with the following code:

NSString *urlAddress = [NSString stringWithFormat: @"http://www.wikipedia.org/wiki/%@",recipe.name];

recipe.name is the entity and property from the core data model

I used NSLog to test the recipe.name and it is outputting correctly to the console

I tried this with just a plain URL and it works fine:

NSString开发者_如何学JAVA *urlAddress = [NSString stringWithFormat: @"http://www.wikipedia.org/wiki/soup"];


  1. Initialize your UIWebView.

  2. Create an NSURL-object containing your url(using +[NSURL URLWithString:] for example).

  3. Create an NSURLRequest-object with the created NSURL-object.

  4. load the NSURLRequest in your webView.

  5. Voila

    :)

0

精彩评论

暂无评论...
验证码 换一张
取 消