需要幫助,從文本框的條目替換我的空間張貼到GET的XCode的iOS替代空間與+
我當前的代碼:
NSString* urlString = [NSString stringWithFormat:@"http://server.com/ios/add.php?user=iPhone+App&message=%@", messageBox.text];
NSURL *add = [NSURL URLWithString:urlString];
[messageView loadRequest:[NSURLRequest requestWithURL:add]];
不過我試過
NSString *finalAdd = [add stringByReplacingOccurrencesOfString:@" " withString:@"+"];
[URL解碼/編碼的NSString]的可能重複(http://stackoverflow.com/questions/6688287/url-decoding-encoding-nsstring) –