47564

Application folder name changes every time i run in simulator [duplicate]

Question:

This question already has an answer here:

<ul><li> <a href="/questions/25233386/xcode-6-keeps-renaming-my-apps-directory-in-ios8-simulator-after-each-run" dir="ltr" rel="nofollow">Xcode 6 keeps renaming my app's directory in iOS8 simulator after each run.</a> <span class="question-originals-answer-count"> 5 answers </span> </li> </ul>

Whenever I restart my application it's folder name in finder is changed from

<blockquote>

09323D3F-D371-4556-ABA3-BD23AF487F12

</blockquote>

to

<blockquote>

E771BBEC-ACC6-489C-B7C1-B5FF11004CB2/

</blockquote>

NSHomeDirectory() is changing everytime I run the app in simulator.

Answer1:

Don't save the full path, but just the directory and file name to the images. Since this behavior is new in iOS 8 and can also happen on a real device.

Answer2:

save your file path like as follows :

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *localFilePath = [documentsDirectory stringByAppendingPathComponent:[[yourArray objectAtIndex:indexPath.section]lastPathComponent]];

Answer3:

i think you have this link in your code NSDocumentationDirectory change it into NSDocumentDirectory

NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

Recommend

  • pushViewController Extremely slow
  • Documenting Macro Functions in C++ with Doxygen
  • iPhone: How to Write an Image to Disk in the App Directories
  • java.lang.ClassCastException: android.graphics.drawable.BitmapDrawable cannot be cast to android.gra
  • JQuery Adding link to a table cell
  • Change location to call swagger-ui in Spring
  • Symfony/Doctrine: “Catchable Fatal Error: Object of class could not be converted to string” when pe
  • BASH - ignore hidden files and empty source directory when copying
  • Rails 4: Getting QRCode to display in email via action mailer
  • spark creating too many partitions
  • Can't resize canvas/scale using Fabric.js
  • WPF C# Get Root Node of TreeView
  • Jenkins job DSL plugin - hidden parameter
  • Using JSON.stringify on object without serializer needs to be marked as experimental
  • How to get the device Model in objective c?
  • Normalization does not preserve code point
  • How to delete file that is created using Uri?
  • Footer appears next to section instead of below
  • What is add2 for sortfields
  • Issue with java String and String Builder
  • Color axis spine with multiple colors using matplotlib
  • Conflict. The container name “/gitlab-runner” is already in use by container
  • Images tile on Google map in android
  • Response.ContentType = “application/vnd.ms-excel” works in IE and firefox but not in Safari
  • Android BottomNavigationView with Badge [closed]
  • How to run the linux/x86/shell_bind_tcp payload stand alone?
  • Integrating Yelp API v2 into iOS 7 app
  • Upload video and extract thumbnail using Amazon s3
  • Getting an error serving images from App_Themes when using precompilation?
  • get value using jquery
  • How to hide 'Add To Cart' for variable products, but keep product variations visible
  • Limit # of records returned based on a form control
  • JSF validateLength question
  • Can I switch the 'connected' user within an sql script that is sourced by mysql?
  • Gitlab: copy project to other git lab repository
  • Homomorphic filtering in OpenCV
  • How to get “crispEdges” for SVG text?
  • JQuery Mobile Ajax Navigation in Single-Page Template
  • How to select multiple items from a List view - JavaFX 8
  • flex tree gets chopped even after using scroll bar