osx - Writing to derived data in an archived app -


i produced .aiff file in app , it's in derived data folder, somewhere deep in /library. when run app in xcode works fine. when archive it, program crashes when tries write. how solve this? need learn use core data or there easy fix?

are trying write current working directory?

(if you're trying [foo writetofile:@"output.aiff" …], are.)

when run within xcode, cwd build products directory within deriveddata application's bundle gets created.

when run outside of xcode, cwd root of startup disk, not ordinarily have write access , should never touch without explicit orders , permission user (via open panel or similar).

either way, cwd wrong place put things.

you should run save panel, write file in completion handler the url save panel has you.

if want stash file in constant directory, ask nsfilemanager for caches folder in the user domain (~/library/caches), tell create folder inside folder name main bundle's bundleidentifier, write file in directory.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -