Joined July 2013
·

Nikola Lajic

Serbia
·
·

I can't verify how command line tools are installed in 10.9 since I already had them installed before updating, but updates of command line tools are now handled trough the App Store.

Posted to Method to convert NSDate to NSString over 1 year ago

You could also have a NSDateFormatter in the class and use "– stringFromDate:". Mind you, changing the format is almost as expensive as creating a new formatter so if you need multiple date formats create multiple formatters.

I haven't tested the difference between your method and NSDateFormatter so if someone has some free time I would also like to see how they compare.

That's pretty sweet, especially the tablecloth demo :)

Two things though, when moving objects fast enough they can pass trough other objects and the tablecloth demo seems to lack any kind of damping (air resistance).

As side note, to anyone who doesn't know, date formatters should be reused as much as possible. Also changing the date format is almost as costly as creating a new date formatter so it is often wise to create multiple instances with different date formats.

Posted to RGB to UIColor over 1 year ago

If you work with designers they'll mostly send you hex color values. I use this:

#define UIColorFromHEX(hex, a)     [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16))/255.0 green:((float)((hex & 0xFF00) >> 8))/255.0 blue:((float)(hex & 0xFF))/255.0 alpha:a]

Just use it like

view.bacgkroundColor = UIColorFromHex(#585858, 1.0);
Achievements
1 Karma
0 Total ProTip Views