tags:

views:

53

answers:

1

I'm just trying to set my text textfield to the same color as the detail text label colour which seems to be the correct way to do it, seen something providing this as an answer here, but I'm getting an error, any ideas ?

txtPassword.textColor = cell.detailTextLabel.textColor;

 Assertion failure in -[UITextFieldLabel setTextColor:], /SourceCache/UIKit_Sim/UIKit-1262.60.3/UILabel.m:312
 Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: color'
A: 

The problem here is with cell.detailTextLabel.textColor detailTextLabel is not defined for the UITableViewCellStyleDefault.

You can confirm if the issue is with cell.detailTextLabel.textColor or something else by trying to set the color directly i.e txtPassword.textColor = [UIColor blueColor];

SegFault
So the supposed UIColor he gets from the label is actually nil and hence there is an error?
Andrew J. Brehm
I am not sure.. but I guess failure is triggered by detailTextLabel being not defined.
SegFault