Как установить Kerning в iPhone Uilebel

Я разрабатываю приложение для iPhone, и я хочу установить Kerning в UILabel. Код, который я написал (возможно, вокруг KCTKERNATTRIBUTENTENAME ), кажется, в ошибке. Как я могу подойдет исправить это?

NSMutableAttributedString *attStr;   
NSString *str = @"aaaaaaa";    
CFStringRef kern = kCTKernAttributeName;        
NSNumber *num = [NSNumber numberWithFloat: 2.0f];    
NSDictionary *attributesDict = [NSDictionary dictionaryWithObject:num 
forKey:(NSString*)kern];        
[attStr initWithString:str attributes:attributesDict];      
CGRect frame1 = CGRectMake(0, 0, 100, 40);    
UILabel *label1 = [[UILabel alloc] initWithFrame:frame1];    
label1.text = attStr    
[self.view addSubview:label1];
32
задан SSteve 10 September 2011 в 06:48
поделиться