Dblock247
Dblock247

Reputation: 6725

Foundation called mkdir(...), it didn't return 0, and errno was set to 2

I'm following a tutorial in the book Creating iOS 5 Apps Develop and Design. I followed the directions as perfectly as I could but I keep getting this error.

2012-10-27 14:40:14.384 Health Beat[10608:1c0f] Foundation called mkdir("/Users/dblock/Library/Application Support/iPhone Simulator/6.0/Applications/5B498D88-3062-4F89-90E2-4B3155C1E325/Library/Documentation/(A Document Being Saved By Health Beat)"), it didn't return 0, and errno was set to 2.

I started this project and then updated to xcode 4.5.1 in the middle of it. I don't know if there is some setting that may make this not work.

Link to files:

OSX 10.8.2
Xcode 4.5.1 (4G1004)
MBP 15"

Upvotes: 0

Views: 1829

Answers (3)

rob mayoff
rob mayoff

Reputation: 385680

The problem is that you used the constant NSDocumentationDirectory instead of the constant NSDocumentDirectory. Probably you typed NSDoc and then accepted the autocompletion, and Xcode autocompleted the wrong constant.

To find it, choose Edit > Find > Find in Workspace, or press Command-Shift-F, and search for NSDocumentationDirectory.

Upvotes: 8

iDev
iDev

Reputation: 23278

Either reset your simulator, clean the xcode build and try running it. Or go to /Users/dblock/Library/Application Support/iPhone Simulator/6.0/Applications and remove the folder 5B498D88-3062-4F89-90E2-4B3155C1E325 and run again. That could be the issue here.

Upvotes: 0

Jonathan Grynspan
Jonathan Grynspan

Reputation: 43472

An errno value of 2 corresponds to ENOENT. Are you sure all the path components before the last exist? mkdir() is not recursive.

Upvotes: 0

Related Questions