hanumanDev
hanumanDev

Reputation: 6614

UIWebView - adding an object to the address

I have a UIWebView that I'd like to load a web page and also append an object to the end of the address.

this is what I have:

NSString *urlAddress = @"http://www.wikipedia.org/%@",recipeName;

the name of a particular recipe would be appended to the end of the URL

I'm getting the "statically allocated instance of Objective-C class NSString" error. Is my syntax incorrect or is it something else?

I've been looking at this for quite a while now and thought I'd ask the community here.

thanks in advance.

Upvotes: 0

Views: 161

Answers (3)

Eric Fortin
Eric Fortin

Reputation: 7603

You cannot create string with format directly, try [NSString stringWithFormat].

Well not fast enough I guess ...

Upvotes: 0

Suresh Varma
Suresh Varma

Reputation: 9740

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

Try this code it will work..

hAPPY cODING...

Upvotes: 1

Gubb
Gubb

Reputation: 421

Try this:

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

Upvotes: 0

Related Questions