I have an NSFileWrapper directory in which I would like to update a specific FileWrapper. I was wondering what is the best way to do this?
So far I have used this code:
[self.fileWrapper addRegularFileWithContents:photoData preferredFilename:@"photo.data"];
However, whenever FileWraper already exists, I get duplicates in FileWrapper that look like this:
"1__# $!@ %!#__photo.data" = "<NSFileWrapper: 0x6bb0260>"; "2__# $!@ %!#__photo.data" = "<NSFileWrapper: 0x6b89b80>"; "3__# $!@ %!#__photo.data" = "<NSFileWrapper: 0x6ba1700>"; "4__# $!@ %!#__photo.data" = "<NSFileWrapper: 0x6bc8480>"; "photo.data" = "<NSFileWrapper: 0x6bcfc50>";
How can I prevent this and just replace FileWrapper - in this case photo.data? I did not find any way to replace FileWrappers in the NSFileWrapper Class Reference .
source share