Any thing can be a dictionary key? Yes, but with a price

January 14, 2014

I like to talk about the difference between different NSDictionary keys. I know it’s cliché.[1]

We all know that building a dictionary is slower than querying it, and that the time it takes to insert or update values depends on the hash function of the key – the interesting part is how incredibly inefficient the hashes of built in objective-c components can be.

Read the rest of this entry »

Advertisements

Instantiating custom views from nib

October 18, 2011

Hi again everyone!

Subclassing UIView to create your own custom class is one of the most frequent tasks an iOS developer has to do.

And for me at least, every time that i created my own custom view, i was torn apart by what is the correct and more convenient way to design my view – from code or from interface builder. I always thought that there was no “right answer”, and that this decision depends on the scenario.
I was wrong. Using interface builder is better. Let’s see why.
Read the rest of this entry »