objective c - Copy file to App Document folder automatically -


i want copy set of files project resource folder app document folder automatically @ time of app first launch. can this. need through code.

bool success; nserror *error;  nsfilemanager *filemanager = [nsfilemanager defaultmanager];  nsstring *documentsdirectory = [nshomedirectory() stringbyappendingpathcomponent:@"documents"]; nsstring *filepath = [documentsdirectory stringbyappendingpathcomponent:@"data.txt"];  success = [filemanager fileexistsatpath:filepath]; if (!success) {          nsstring *path = [[nsbundle mainbundle] pathforresource:@"data" oftype:@"txt"];     success = [filemanager copyitematpath:path topath:filepath error:&error];  } 

in application did finish launching options


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -