0

I hope to read/write a byte of a binary file. Is it possible to access binary file and write/read a byte of the file using objective-c? Just like C can do?

Welcome any comment

2 Answers 2

5

Objective-C is a proper superset of C. Not only does it have its own file I/O methods, you can do exactly what you would do in standard C to access files.

Sign up to request clarification or add additional context in comments.

Comments

5

There is a class in COCOA called NSData. You can call "dataWithContentsOfFile" class method to load bytes from file into NSData object. Use "writeToFile:options:error:" to write bytes back to file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.