开发者

UIWebView - NSStringWithFormat [closed]

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜