I am currently trying to read a line of 5 characters from a offset in my text file. I am pretty sure everything is working however when I print the contence of my buffer to the log, it outputs this <7466315c 61>
- (void)fetchCode:(id)sender{
NSData *databuffer;
NSString *path = [[NSBundle mainBundle] pathForResource:@"nCode01" ofType:@"txt"];
nCode = [NSFileHandle fileHandleForReadingAtPath:path];
if (nCode == nil) {
NSLog (@"Open of nCode for reading failed\n");
}
[nCode seekToFileOffset: 3];
databuffer = [nCode readDataOfLength: 5];
NSLog (@"Data = %@", databuffer);
[nCode closeFile];
}
I think it might be a format error, not a memory as each time I run the method it prints the same <7466315c 61> any idea of what I am missing / doing wrong?