

Reader-submitted Objective-C / XCode tips of 2012 - cozykozy
http://www.nshipster.com/reader-submissions-new-years-2013/

======
stephth
_Displaying his characteristic brilliance and familiarity of Cocoa internals
Cédric Luthi submitted a reverse-engineered implementation of the NString
equality methods. Fascinating!_

Forgive my ignorance, but how do you go about and reverse engineer NSString
equality? Looking at the code is interesting but what I'd really like to
understand is where it comes from and how it was extracted; is it supposed to
be close to the original implementation, is it an informed guess based on
CFLite, ...? Please be patient and again forgive my ignorance.

~~~
mayoff
He probably used Hopper, which he has tweeted about.
<http://www.hopperapp.com/>

------
matttthompson
For clarification, this is a list of some reader-submitted tricks and tips
from the last month, as a way to bring in the New Year.

I'm looking forward to doing more of these in the future, so if anyone has any
ideas or suggestions, feel free to tweet them to @NSHipster. Thanks!

~~~
zbowling
Hey Matt, I have some amazing tricks for you but I want to save it for a
Cocoaheads talk first. :-) We should get around to doing another.

Reimplementing the runtime and foundation and hacking on our Clang fork at
Apportable the last 6 months, I've learned some amazingly interesting things.

~~~
alexkcd
Second that. I was pretty upset that I couldn't make it to the last one.

Also, on the tricks front: I was proxying UITableViews to override their
layout before UICollectionViews were cool :)

------
orta
As these are reader submitted, I thought I would mention that I've just
released a library for dealing with multiple analytics providers with a single
API: <https://github.com/orta/ARAnalytics>

------
gdubs
One I personally really like is typing "target modules lookup --address" in
the debugger, followed by a hex value. Really helpful if your app crashes
without an interactive stack trace, as it lets you figure out where the crash
occurred in your code.

------
mikeash
The suggestion that "+initialize is great for registering NSURLProtocol,
NSValueTransformer, and NSIncrementalStore subclasses" is, alas, off the mark.
If you use +initialize for anything that needs to be registered before it gets
used, you'll end up with a chicken-and-egg problem, because +initialize
doesn't run until the class's first use. +initialize is great for one-time
setup of class-wide data, but it doesn't work for registering classes with the
system when the act of registering is the only thing that causes them to be
used.

------
orta
The LLDB View Hierarchy Dump tip is something that I think I can use again and
again and again.

~~~
cozykozy
Definitely beats view.backgroundColor = [UIColor redColor];! Though I'm not
sure I'll ever to shake that trusty old "debugging" hack.

~~~
orta
I keep some UIColor categories around so at least I can have prettier colours
for debugging. It would be nice to make a variant of the method that (somewhat
randomly) colours all views and logs the usual info + the colour out to the
console.

