On Apr 9, 2013, at 6:23 AM, Rich Siegel < email@hidden> wrote: It sounds like the linker is organizing your code a little differently each time, perhaps depending on the content of that table. (For example, if it compresses differently.) I am not sure if there's a way to influence that, or not.
This kind of unpredictable ordering can happen if something (the linker in this case) uses a hash-table/dictionary where the keys are based on object pointers instead of contents. Since the pointer values are unpredictable between runs, so are the hash codes, and so iterating the hash table will produce the values in a different unpredictable order.
(Exactly this occurs, or used to occur, when loading views from a nib. The effect to the app code is that -awakeFromNib methods are called in a random order that can vary from one run to the next, sometimes triggering intermittent bugs if you have dependencies between the methods. It was very confusing when I ran into it!)
At a more practical level, I echo Rich’s suggestion to use code signing, since it sounds like you’re trying to do exactly the same thing. With the caveat that it’s not hard to break any kind of anti-tampering mechanism like this by patching the checksum as well as the code. If you’re hoping this will keep your app off of warez sites, it’s not going to work.
—Jens |