ludo
ludo

Reputation: 1479

Display Image using object (Iphone)

Here is what I have:


 smallURL:(@"bundle://image.jpg")

this line will display me a picture store in the local path, no problem everything works fine. Now I'm using an object because the name for my picture will be store in my database, so I want to use the line like that:


 smallURL:(@"bundle://%s", [visuel lpath])

My problem is "%s" its not working do I have to use %@, %i... can someone help me and explain all the diference..

Thanks,

Upvotes: 0

Views: 299

Answers (2)

Hoang Pham
Hoang Pham

Reputation: 6949

  smallURL:([NSString stringWithFormat:@"bundle://%@", [visuel lpath]])

Upvotes: 2

Alexei Sholik
Alexei Sholik

Reputation: 7469

If lpath is of type NSString then you should use %@. It is used every time you need to convert a Cocoa object (or any other descendant of NSObject) into its string representation.

smallURL:(@"bundle://%@", [visuel lpath])

Upvotes: 1

Related Questions