Closed ilyakaz closed 8 years ago
You'll need to pass in the ZZOpenOptionsCreateIfMissingKey
to enable writing
let zipArchive = try ZZArchive.init(data: NSMutableData(), options:[ZZOpenOptionsCreateIfMissingKey: true])
The API here is somewhat confusing, at some stage I'll go over it with a fine tooth comb and make it more usable.
Great, this works! Thank you!
I can't find ZZMutableArchive in the current code. I tried initializing a ZZArchive instead in Swift based on sample code suggested in here, as follows:
let zipArchive = try ZZArchive.init(data: NSMutableData())
This code throws this error:
fatal error: 'try!' expression unexpectedly raised an error: Error Domain=com.pixelglow.ZipZap Code=0 "(null)" UserInfo={NSUnderlyingError=0x1546b0aa0 {Error Domain=NSCocoaErrorDomain Code=260 "The file couldn’t be opened because it doesn’t exist."}}: file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-703.0.18.1/src/swift/stdlib/public/core/ErrorType.swift, line 54