我正在尝试编写一个动态 URL,除了以这种方式附加字符串之外,还有其他更简单的方法吗?这似乎效率低下。
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];