When using NSHomeDirectory() inside a unit test I get:
/Users/hgpc/Library/Application Support/iPhone Simulator/5.0
I expected the actual home directory of the current application. Something like:
/Users/hgpc/Library/Application Support/iPhone Simulator/5.0/Applications/6D1091C6-02AE-4803-A7DF-D623D0F89579
What am I doing wrong?
To solve this, set the value of Bundle Loader within your Unit Test target build settings to:
$(BUILT_PRODUCTS_DIR)/MyAppName.app/MyAppNameand also your Test Host to:
$(BUNDLE_LOADER)you should then find
NSHomeDirectory()returns the right value.