我在 xcode 4.5 和 sdk 6.0 中发现了另一个恼人的错误:当我运行以下代码时:
UIColor *newcolor = [UIColor colorWithCIColor:[CIColor colorWithString:@"1 1 1 1"]];
[button setTitleColor:newcolor forState:UIControlStateNormal];
UILabel *lbl = selectedbutton.titleLabel;
它总是因错误而失败:
-[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