I want to read a large file in objective-c, and used in iphone development
I used the follow code
NSData *data = [[NSData alloc] initWithContentsOfFile:file];
unsigned char *readData[2000];
[data getBytes:readData range:NSMakeRange(1000,3000)]
This maybe get the iphone app crash, because the size of the file is large.
I tried to use NSInputStream, but I can’t find the range parameter in any method, can anyone give a help?
Thanks & Best Regards
Timmy
Use
NSFileHandle: Seek to the offset where your data starts and start reading from there.