ios - What is the hexadecimal part in the Documents folder's path? -


I have a file in my app's document folder. When the app is finished, I save the url of the file in the applicationWillTerminate method of the appadailate: // archiver init code [archiver encodeObject: file.URL forKey: kFileURL];

To complete the file encoding and write the data

but the file manager file was not detected when trying to restore the file Can: After Calling

  NSURL * fileURL = [Without Rectangle Decoded ObjectFor: kFileURL]; NSString * filePath = fileURL.path;   

method

  [[NSFileManager defaultManager] filesyxist: filepath]; Returns   

no .

I tried to find the reason for this and I came to know that the document code> changes the folder changes with each app launch which is the hexadecimal folder in the middle. Here are two examples Given:

  / personal / var / mobile / application / 04083 A4A-87 ACC-4E3C-8Ba1-F002B97AE304 / document /. .. / private / var / mobile / applications / 65 D1 36BA-42C3-887A-B947-7FE396978153 / document / ...   

I always thought that the heck Sadesiml part of the ID of a specific type for every application, but as it changes: the number is exactly what? And how do I delete my file again and then launch my app?

You simply load your file for the Directory document folder and then.

  + (NSString *) documentDatePath {NSArray * path = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES); If ([path count] == ​​0) {return zero; } NSString * directory = [path object at indexX: 0]; If (directory == blue) {NSLog ("NSDocumentDirectory not found!"); } Return directory; }    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -