I'm building an app for iOS 5.x and am trying to use the new UIAppearance
capability.
I want to style a UISegmented Control title as follows:
UISegmentedControl *segmentedControl = [[UISegmentedControl alloc]
initWithItems:segments];
segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
segmentedControl.frame = CGRectMake(0, 0, 400, 30);
[segmentedControl addTarget:self action:@selector(segmentAction:)
forControlEvents:UIControlEventValueChanged];
segmentedControl.momentary = YES;
segmentedControl.backgroundColor = selectedTintColor;
[[UISegmentedControl appearance] setTitleTextAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"Helvetica" size:20.0f],
UITextAttributeFont, [UIColor whiteColor], UITextAttributeTextColor, nil]];
This compiles but throws this exception:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:
'-[_UIAppearance setTitleTextAttributes:]: unrecognized selector sent to
instance 0x7c957d20'
I would appreciate any help in understanding what I'm doing wrong..
Thanks!
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]