Quantcast
Channel: February 2014 – Michael Tsai
Viewing all articles
Browse latest Browse all 52

Embedding Resource Files in a Cocoa Foundation Command Line Tool

$
0
0

Drew McCormack:

Graham Lee and several others pointed me to two standard solutions: you can use the linker to embed the files in the __text section of the Mach-O binary, or you can use a tool called xxd to convert the file’s data to a C array, and include that directly in your source code. I ended up with the second solution, which I will explain further below. I didn’t investigate using the linker, but Quinn “The Eskimo!” assures me that you use getsectXXX APIs to extract the data at run time. (Update: Daniel Jalkut has a post describing this approach.)


Viewing all articles
Browse latest Browse all 52

Trending Articles