Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Xcode 7(beta 5)的最新版本中,NSString 方法 stringByAppendingPathComponent: 已被完全删除。这在处理文件路径时非常有用
是否有新的方法来替代它或实现类似的功能?
它删除到 NSURL,你可以使用这个:
NSURL(string: yourPath)!.URLByAppendingPathComponent(pathComponent)
或为了大多数兼容性
NSString(string: yourPath).stringByAppendingPathComponent(pathComponent)