Top "Nsfilemanager" questions

The NSFileManager class enables you to perform various generic file-system operations and insulates an application from the underlying file system.

NSFileManager.defaultManager().fileExistsAtPath returns false instead of true

How is it possible? let exists = NSFileManager.defaultManager().fileExistsAtPath(path.absoluteString) print("exists: \(exists)") //false This is path.absoluteString //file:///…

ios swift nsfilemanager
max length of file name

i am using the code below to save an image in the NSDocumentDirectory -(BOOL)saveImage:(UIImage *)image name:(NSString *)…

iphone nsfilemanager nsdocumentdirectory
NSFileManager createFileAtPath failing on iPad but works on Simulator

I am trying to write a simple log file for each execution of my app. The logfile name is based …

ios objective-c nsfilemanager createfile
Creating a ZIP file from a string in Swift

let data = "InPractiseThisWillBeAReheallyLongString" createDir() let docsDir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! let ourDir = docsDir.appendingPathComponent("ourCustomDir/") let …

ios swift zip nsfilemanager ssziparchive
Why NSMutableDictionary don't want write to file?

- (void)viewDidLoad { [super viewDidLoad]; if ([[NSFileManager defaultManager] fileExistsAtPath:pathString]) { infoDict = [[NSMutableDictionary alloc] initWithContentsOfFile:pathString]; } else { infoDict = [[NSMutableDictionary alloc]initWithObjects:[…

iphone ios nsmutabledictionary nsfilemanager
Swift 3: Error in copying file with FileManager

I have a file named Data.plist in my main bundle (at the root of the app directory), and I …

ios swift3 nsfilemanager copy-item
fileManager.createFileAtPath always fails

I try to call the fileManager.createFileAtPath-method, but it always fails. My variable success is always false. I looked at …

ios swift nsfilemanager
NSFileManager - Check file size?

I am recording sound file in one of my apps. I am trying to figure out how to get the …

ios nsfilemanager
How to find out if the NSURL is a directory or not

I have a NSURL object. It has address of a filesystem element, it is either a file or a directory. …

objective-c file directory nsurl nsfilemanager
NSFileManager's method createDirectoryAtPath returns false result on iOS

When I try to create a folder using the code bellow it returns NO with an error when I try …

ios directory nsfilemanager create-directory