I'm wondering if 开发者_开发知识库there is a diff API in Cocoa, I've attempted to google it but its not bring back any results that are useful.
If there isn't an API for this would it be better to call diff
from /usr/bin/ or to write my own diff.
All I need it for is text-files with a possibility of branching out into binaries and folders later.
Thanks
James
Since this question was answered, it appears that something has come out:Diff Match and Patch libraries
I haven't tried it (yet) but it's what came up when I was looking for a diff library. There is an Obj-C port.
You would normally just use diff
itself. All the command line tools are accessible via NSTask and NSPipe. It's trivial to write a wrapper class that manages it all for you.
We recently remade an old project which applies a patch on your iOS device.. We used it to create diff files from a pc, make the iOS client download the patch and apply it. It is called PatchPatch and it can be found here
https://bitbucket.org/Jkok/patchpatch
Try it out and let me know if it works for you.
精彩评论