i want read data from the binary f开发者_运维百科ile named "xyz.bin" and want to parse data according to algorithm can any buddy suggest how to get dat from binary file and perform read and write operation on that binary file
if you're trying to access a file within your application bundle, you need to get the full path to it: [[NSBundle mainBundle] pathForResource: FILENAME ofType: FILEEXTENSION]
This returns an NSString, which you can pull a UTF8String out of and pass to fopen.
You want
NSData's
+ dataWithContentsOfURL:
or + dataWithContentsOfFile:
for input
and
– writeToFile:options:error:
or – writeToURL:atomically:
for output
What you do with the data in between is up to you.
精彩评论