简体   繁体   中英

stringByAppendingPathComponent: in Xcode 7 beta 5

In the latest build of Xcode 7 (beta 5), the NSString method stringByAppendingPathComponent: has been entirely removed. This had been incredibly useful when working with file paths

Is there a new method to replace this or achieve similar functionality?

It removed to NSURL, you can use this:

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

or for most compability

 NSString(string: yourPath).stringByAppendingPathComponent(pathComponent)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM