-1
我試圖編寫一個動態的URL,除了這樣做還有更簡單的方法來追加字符串嗎?這似乎效率低下。有沒有更簡單的方法將文本附加到NSString?
NSString *folder1 = @"sonic";
NSString *folder2 = @"usr";
NSString *url = @"http://www.mydomain.com";
url = [url stringByAppendingFormat:@"/"];
url = [url stringByAppendingFormat:folder2];
url = [url stringByAppendingFormat:@"/"];
url = [url stringByAppendingFormat:folder1];
謝謝,工程:) – sonicbabbler