0

在 Xcode 7(beta 5)的最新版本中,NSString 方法 stringByAppendingPathComponent: 已被完全删除。这在处理文件路径时非常有用

是否有新的方法来替代它或实现类似的功能?

4

1 回答 1

0

它删除到 NSURL,你可以使用这个:

  NSURL(string: yourPath)!.URLByAppendingPathComponent(pathComponent)

或为了大多数兼容性

 NSString(string: yourPath).stringByAppendingPathComponent(pathComponent)
于 2015-09-18T10:32:06.407 回答