I found another annoying bug with xcode 4.5 and sdk 6.0 : when I run the following code :
UIColor *newcolor = [UIColor colorWithCIColor:[CIColor colorWithString:@"1 1 1 1"]];
[button setTitleColor:newcolor forState:UIControlStateNormal];
UILabel *lbl = selectedbutton.titleLabel;
It always fail with the error :
-[UICIColor colorSpaceName]: unrecognized selector sent to instance 0xa9864f0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICIColor colorSpaceName]: unrecognized selector sent to instance 0xa9864f0'
*** First throw call stack: [...]
libc++abi.dylib: terminate called throwing an exception
I was in the same situation as you where I had a string of the constituent values of the RGB UIColor
Although using CIColor colorWithString: is much more compact to get rid of the error I converted it manually:
This certainly isn't the most elegant way of doing it but is a good fix if this suddenly becomes an issue after an update.
I found a workaround : before using my colorWithCIColor, I made a copy of it with :
and it solves the crash. Strange, anyway