RKManagedObjectStore objectStoreWithStoreFilename doesn't create the directory #657

Closed
amyworrall opened this Issue Apr 10, 2012 · 1 comment

Projects

None yet

2 participants

@amyworrall

If I call [RKManagedObjectStore objectStoreWithStoreFilename:@"test.sqlite"] when the directory ~/Application Support/MyApp/ exists, it works.

If I call the former when the latter does not exist, I get an assertion failure:

Managed object store failed to create persistent store coordinator: Error Domain=NSCocoaErrorDomain Code=258 "The file name is invalid." UserInfo=0x7fb800c51e30 {NSUnderlyingException=Error validating url for store}

I believe the method createPersistentStoreCoordinator on RKManagedObjectStore should check for the existence of such a directory, and create it if necessary.

@blakewatters
Member

Agreed, will take care of this shortly.

@signalsandstuff signalsandstuff added a commit to signalsandstuff/RestKit that referenced this issue May 31, 2012
@signalsandstuff signalsandstuff Merge branch 'master' of git://github.com/RestKit/RestKit
* 'master' of git://github.com/RestKit/RestKit: (360 commits)
  Fix issue where grouping objects by section in RKTableController and loading an empty collection would fail to refresh table view.
  Fix type mismatch assertion in cases where JSON/XML payload contains a string value for an integer primary key. fixes #754
  Fix static analyzer warning
  Cleanups to and test coverage expansion of RKTableController API's. refs #765
  Update RKTestFactory to silence logging output during setup/tear down operations. closes #764
  Reworked table controller state into a bit mask to coalesce state change into a single observation. fixes #753
  Implemented support for type coercions in primaryKeyAttribute API's. closes #758
  Cancel current object loader when loading a table view
  Clean up inconsistencies with 'cancelled' and 'cancel' to match Cocoa (isCancelled)
  Ensure managed object connections are established across appropriate managed object contexts
  Add RKLog helper for displaying detailed key-value validation failure information. closes #750
  Bump version to 0.10.1
  Fix for RestKit#709 - [RKManagedObjectThreadSafeInvocation serializeManagedObjectsForArgument:withKeyPaths:] is not properly serializing managed objects
  Ensure creation of Application Data directory when initializing Managed Object Store. fixes #657
  Add tests verifying expected behavior for availability of RKRequest response property. closes #527
  Eliminate duplication of request method to string logic in [RKRequest HTTPMethod]
  Migrate RKResponse property from RKObjectLoader to RKRequest. refs #527
  Fix static analyzer issues
  Replace v0.9.4 references with 0.10.0
  Rework intermittently failing tests
  ...

Conflicts:
	Code/Network/RKRequest.m
6b46630
@smclelland smclelland pushed a commit to smclelland/RestKit that referenced this issue Jun 7, 2012
smclelland Merge branch 'master' of git://github.com/RestKit/RestKit
* 'master' of git://github.com/RestKit/RestKit: (109 commits)
  Fix issue where grouping objects by section in RKTableController and loading an empty collection would fail to refresh table view.
  Fix type mismatch assertion in cases where JSON/XML payload contains a string value for an integer primary key. fixes #754
  Fix static analyzer warning
  Cleanups to and test coverage expansion of RKTableController API's. refs #765
  Update RKTestFactory to silence logging output during setup/tear down operations. closes #764
  Reworked table controller state into a bit mask to coalesce state change into a single observation. fixes #753
  Implemented support for type coercions in primaryKeyAttribute API's. closes #758
  Cancel current object loader when loading a table view
  Clean up inconsistencies with 'cancelled' and 'cancel' to match Cocoa (isCancelled)
  Ensure managed object connections are established across appropriate managed object contexts
  Add RKLog helper for displaying detailed key-value validation failure information. closes #750
  Bump version to 0.10.1
  Fix for RestKit#709 - [RKManagedObjectThreadSafeInvocation serializeManagedObjectsForArgument:withKeyPaths:] is not properly serializing managed objects
  Ensure creation of Application Data directory when initializing Managed Object Store. fixes #657
  Add tests verifying expected behavior for availability of RKRequest response property. closes #527
  Eliminate duplication of request method to string logic in [RKRequest HTTPMethod]
  Migrate RKResponse property from RKObjectLoader to RKRequest. refs #527
  Fix static analyzer issues
  Replace v0.9.4 references with 0.10.0
  Rework intermittently failing tests
  ...

Conflicts:
	Code/Support/Parsers/JSON/RKJSONParserJSONKit.m
c126532
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment