0

サウンド ファイルである ZIP ファイルをエクスポートしたいと考えています。

次に、プッシュ通知を使用してこのサウンド ファイルを制御したいと思います。

サウンド ファイルを Xcode に直接ロードすると、機能します。しかし、ファイルが見つからない ZIP ファイルを使用してファイルをエクスポートしますか?

彼がファイルを見つけられないかのように?私は何を間違っていますか?

エラーがここにあると思われます:toDestination:@""

https://github.com/soffes/ssziparchive

構造

- (IBAction)sound_ko:(id)sender {
    //File check...

    NSBundle *mainBundle = [NSBundle mainBundle];
    NSString *myFile = [mainBundle pathForResource: @"KO" ofType: @"zip"];

    BOOL fileExists2 = [[NSFileManager defaultManager] fileExistsAtPath:myFile];
    if (fileExists2 == NO){
        NSLog(@"DOESNT Exist!");
    } else {
        NSLog(@"DOES Exist!");
    }

    //Unzip File
    if( [SSZipArchive unzipFileAtPath:myFile toDestination:@""] != NO ) {
        NSLog(@"Dilip Success");
    }else{
        NSLog(@"Dilip Error");
    }
}
4

2 に答える 2

1

エラーポインターを渡して、これを使用して迅速に詳細情報を受け取る方法があります。

SSZipArchive.unzipFileAtPath(libAssetPath.path, toDestination: libSupportPath.path, overwrite: true, password: nil, error: &err, delegate: self)

                if(err != nil){
                    print("\(err.debugDescription)")
                }
于 2015-11-05T19:40:25.927 に答える