-2
私のアプリ全体でiTunesファイル共有を使用しています。私のアプリはiTunesファイル共有を使って転送できるいくつかのファイルを提供しています。しかし、その時点でユーザーは削除することができます(基本的に何も共有可能な私のアプリの中に何かをする) 私はそれを作る方法を知りたいので、ユーザーはこれらの特権を持っていません、ファイルを転送して、それを行います。iOS - iTunesファイル共有を使用して文書を編集できないようにする
相続人は非共有ディレクトリへの共有ディレクトリからのコード、任意の助けもはるか
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSArray *names = [NSArray arrayWithObjects: @"test.gif", @"test1.gif", nil];
for (NSString *fileName in names)
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *documentDBFolderPath = [documentsDirectory stringByAppendingPathComponent:fileName];
if (![fileManager fileExistsAtPath:documentDBFolderPath])
{
NSString *resourceDBFolderPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:fileName];
[fileManager copyItemAtPath:resourceDBFolderPath toPath:documentDBFolderPath error:&error];
}
}
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
どうすればよいですか? –