Home > Cocoa Error > Cocoa Error 512 Failed To Create File

Cocoa Error 512 Failed To Create File

I followed the following tutorial: http://wiresareobsolete.com/wordpress/2009/12/adding-core-data-existing-iphone-projects/ It produces an error at the following code: (NSPersistentStoreCoordinator *) persistentStoreCoordinator{ if (persistentStoreCoordinator != nil){ return persistentStoreCoordinator; } NSURL *storeUrl = [NSURL fileURLWithPath: [[self applicationDocumentDirectory] more hot questions question feed default about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation On which physical drive is this logical drive? Why don't my users have separate desktops in Windows 10? check over here

Who created the Secret Stairs as a way into Mordor and for what purpose? Is the Joker based on anything? In a pudding I eat, I give bread its potential A 17th century colloquial term for children, in the way we use 'kids' today What happens if BB-8 rolls the wrong I figured out what the problem is though.

Education or employment: What is a post-doc? returned error Error Domain=NSCocoaErrorDomain Code=512 "The file couldn't be saved." UserInfo={reason=Failed to create file; code = 1} with userInfo dictionary { reason = "Failed to create file; code = 1";}=============================Any suggestion Here is the code snippet which causes the error: - (NSPersistentStoreCoordinator*) persistentStoreCoordinator { NSError* error = nil; NSURL* storeURL = [[[NSBundle mainBundle] resourceURL] URLByAppendingPathComponent: @"users.sqlite"]; if (_persistentStoreCoordinator != nil) return _persistentStoreCoordinator;

You should not use this function in a shipping application, although it may be useful during development. Using path instead should fix the problem: NSString *storePath = [[[self applicationDocumentsDirectory] path] stringByAppendingPathComponent:@"Prova1.sqlite"]; share|improve this answer answered Oct 22 '12 at 13:41 Martin R 257k27485557 Thanks for your Browse other questions tagged ios iphone sqlite core-data or ask your own question. Should I have doubts if the organizers of a workshop ask me to sign a behavior agreement upfront?

Authoritative source that <> and != are identical in performance in SQL Server Bayesian vs Frequentist: Practical Difference At age 25, is it still okay to wear braces to work? Not the answer you're looking for? Please type your message and try again. In my unit test target I've also included the .sqlite file. –Iphone Developer Oct 13 '12 at 0:42 @IphoneDeveloper check stackoverflow.com/questions/7906330/….

Cycles, shade based on proximity to another object's geometry How to change "add to cart" text on category view? Avoid comments like “+1” or “thanks”." >add a comment|

Should hamburger menu be on left or the right? http://stackoverflow.com/questions/16988685/error-when-trying-to-copy-file Is the following sentence correct? 'The time when the church dates back to is the 13th.' * Fired because your skills are too far above your coworkers Why does the '!!' more hot questions question feed about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation Science Too many reports because of too convenient report button Authoritative source that <> and != are identical in performance in SQL Server more hot questions question feed lang-sql about us tour

Join them; it only takes a minute: Sign up CoreData PersistentStorage failed to create file up vote 0 down vote favorite I have a problem on iOS 8.1 with CoreData. check my blog When I build for iOS 5.0 there is no error and core data works successfully. Can Mage Hand wield a Shield? Head, Shoulders, Knees and Toes, Knees and Toes Required financial support for a Schengen visa to visit Norway How to explain lack of flatland?

I think it's worse. CoreData AddPersistentStore error 512 on real device 869Views 5 Replies Latest reply: Oct 6, 2015 5:13 PM by fulkron Level 1 (0 points) fulkron Sep 26, 2015 6:34 PM I'm porting If cookies are made with enough sugar, will they just be chewy caramel? this content Can Mage Hand wield a Shield?

Avoid answering questions in comments." >add a comment|

I get a Cocoa Error 512 and what I figured about that is, that it's not a valid directory (or something like that. PPCG Jeopardy: Cops What happened to Home Depot's Stock in 1988?

How worried should I be about getting hacked with PoisonTap?

more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed Head, Shoulders, Knees and Toes, Knees and Toes Education or employment: What is a post-doc? OR You can go through with this link Core Data Tips for iPhone Devs Part 2: Better Error Messages Thanks share|improve this answer edited Jul 15 '12 at 14:34 answered Jul Has a Poké Ball ever captured anything other than a Pokémon?

How can I get bash/zsh to change some text from "foo.foo.foo" to "foo foo foo" with a script/alias? Nice spot. Works in simulator, crashes on device, "The file couldn't be saved."Looks like a beta 2 bug. http://allsoftwarereviews.com/cocoa-error/cocoa-error-516-ios-7.php What is a PhD student?

No files can be copied in documents folder up vote 3 down vote favorite 1 I'm working on a coredata project in a xcode 4.3 version for ios 5.1. Also Make sure you copy the .sqlite file from your library and save it to the applications directory. I've made an ARC empty project with CoreData checkbox selected, following the methods add by xcode to manage model and modified by me following a tutorial for copying a prepopulate sqllite