开发者

Can't return a String value and append it...why?

I am writing an app and am having problems returning a simple string value, and I'm not sure why.

The function I am using (within a file called APIManager.m) is:

- (NSString*) returnVenueUrl {
NSString *venueUrl = [devEnvironment stringByAppendingString:@"venue/id/"];
return venueUrl;

}

I can return this properly by doing this in another .m file:

APIManager *apiManager = [APIManager apiManager];
NSLog(@"view venue URL is here: %@", [apiManager returnVenueUrl]);

But when I go to append a variable cast as a String onto it, I get nothing..

venueURL = [apiManager returnVenueUrl];
venueURL = [venueURL stringByAppendingString:venueId];

NSLog(@"the Full Venue URL is: %", venueURL);

If anyone has any advice 开发者_如何学JAVAon how to fix this, it would be much appreciated!


Use NSMutableString NSString is immutable (aka non modifiable)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜