stringByAppendingPathComponent: in Xcode 7 beta 5

304 Views Asked by At

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?

1

There are 1 best solutions below

0
Yu Jiaao On

It removed to NSURL, you can use this:

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

or for most compability

 NSString(string: yourPath).stringByAppendingPathComponent(pathComponent)