I'm trying to read binary file (level created on a Windows PC) on the iPhone but all my attempts have failed. I don't know why it doesn't. Here is my latest attempt to read the first 32bit int from a file:
int stuff;
NSFileHandle* file = [NSFileHandle fileHAndleForReadingAtPAth: @"level.dat"];
[[file readDataOfLength:4] getBytes:stuff];
stuff = NSSwapLittleIntToHost(stuff);
I don't know if I really need NSSwap but it doesn't give me the correct value either way.
Any ideas?