Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7278665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:54:20+00:00 2026-05-28T22:54:20+00:00

I have been working on a Core Data iOS app that works perfectly through

  • 0

I have been working on a Core Data iOS app that works perfectly through Apple’s “channels” – iOS simulator & Xcode installing, yet when I try to manually install it onto a device, the application crashes. My main goal is to put the app on Cydia.

A guide to preparing an app for Cydia
I read this article, and I at the bottom it said

Appstore app has a Documents folder that is created by the installation process. Jailbroken app does not. It is up to the app to create its own folder. Should you need this type of folder, you must create this with a simple mkdir command in your applicationDidFinishLaunching function. Just add a simple function: mkdir(“/var/mobile/Library/YOURAPPNAME”, 0755); If the folder already exists, no harm done. You want to do this because the install process runs as user root and the app runs as user mobile. If Cydia does this for you then the folder will have the incorrect permissions.

I do not know much about how exactly Core Data works, but I know the Core Data “database” is stored in the Documents folder, and I now believe this is the cause of the crash of my app.

The mkdir function did not work in creating a Documents folder.

How would I go about creating a Documents folder, and how would I get it to work with Core Data, ensuring the database is loaded from this folder I created?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T22:54:21+00:00Added an answer on May 28, 2026 at 10:54 pm

    Most likely you are still using the AppStore friendly Documents path in the methods which create and load the CoreData database file (I think Xcode will put these in your AppDelegate by default).

    Check the method which loads the persistentStorageCoordinator and look for a line like this:

    NSURL *storeUrl = [NSURL fileURLWithPath: [docPath stringByAppendingPathComponent:@"my_cool_app.sqlite"]];
    

    And make sure that docPath is “/var/mobile/Library/My_Cool_App” and not originating from the standard AppStore friendly:

    NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *docPath = [documentPaths objectAtIndex:0];
    

    You might want to create a method which returns the proper Documents directory depending on what target you compile the app for:

    +(NSString *)documentsDirectoryPath
    {
    #ifdef JAILBREAK
    
        NSString *documentPath = @"/var/mobile/Library/My_Cool_App";
    
        if (![[NSFileManager defaultManager] fileExistsAtPath:documentPath])
        {
            [[NSFileManager defaultManager] createDirectoryAtPath:documentPath
                                  withIntermediateDirectories:NO 
                                                   attributes:nil 
                                                        error:NULL];
        }
    
        return documentPath;
    
    #else
    
        NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        return [documentPaths objectAtIndex:0];
    
    #endif
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app, backed by Core Data, that I've been working on for
I have been working with Core Data in an iPad app and I can
I'm diving into iOS development and have been working on an alarm clock app
I've been working on importing XML into an iPad Core Data application. I have
I'm working on an iPhone app that uses Core Data. The app makes a
I have been working on a method to sync core data stored in an
I have an app that I have been working on and I did a
So I am working on an app that uses core data to store attributes
I have been working with a string[] array in C# that gets returned from
I have been working on some legacy C++ code that uses variable length structures

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.