为什么会这样:的NSString stringWithFormat自行添加一个换行符
NSString *url = [NSString stringWithFormat:@"http://www.example.com/profile/%@/?s_iphone=true", author];
NSLog(@"url: %@", url);
输出这样的:
http://www.example.com/profile/AuthorName
/?s_iphone=true
毋庸置疑的URL将不会加载B/C有一个新行添加到字符串本身。我试过删除whitesapces/newlines,仍然有相同的输出。这让我疯狂。
马特
您是否在上面的代码被调用之前检查了'author'来查看换行符是否存在? – matthias 2011-05-06 18:25:52
谢谢,忘了考虑一下。 – MattDice 2011-05-06 18:35:43