An alternative solution would be to use the -[NSFileManager URLsForDirectory:inDomains:]
method and fetching the path from the returned NSArray:
Objective-C:
NSArray *paths = [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask];
NSURL *documentsURL = [paths lastObject];
Swift:
let paths = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)
let documentsURL = paths[0] as! NSURL
This is supported in iOS 4.0+