I have the following NSURL string and I am trying to use the variables to point to a user specific web page to Parse JSON from, What I would like to be able to do is get the information from a UILabel and have it go in the end of URL like so:
NSData* carData = [NSData dataWithContentsOfURL: [NSURL URLWithString:[NSString stringWithFormat:@"http://10.0.0.234:8880/%@", *label.text ]]];
But I can not seem to be able to do this as “Cannot Pass object interface type ‘NSString’ by value to variadic method; expected type from format string was ‘id’
EDIT: I need this to be able to request a ‘username’ (cellphone number) from the User in a settings menu and I need to be able to call up this info to be at the end of the URL eg ‘www.example.com/01223445
If someone could point me in the right direction, it would be greatly appreciated
Why are you using
*label.text? Which will translate into*(label.text)which is a dereferenced NSString. Which is exactly what the compiler is complaining about.You need to do
[NSString stringWithFormat:@"http://10.0.0.234:8880/%@", label.text ]]to get rid of the error. (without the *)