Search code examples
objective-ciosasihttprequestnsurl

Referencing a string inside an NSURL


I'm trying to use this string inside this NSURL however I don't think its right and in turn giving me an ASI HTTP request failed error.

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://furious-ice-356.heroku.com/places/%@/reviews.xml",self.identifier]];

Solution

  • self.identifier returns (in most cases) an object of the type id. You cannot cast this object to a NSString*.

    The only exception is the in 10.7 newly introduced identifier property of NSString* in the NSUserInterfaceItemIdentification protocol.

    Can you elaborate your question so we can see what type self has?