日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CoreText入门

發(fā)布時間:2023/12/15 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CoreText入门 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

學習了網(wǎng)上的一些CoreText知識之后,總結(jié)了一下學習成果,自定義了一個Label控件。

Label特點:

1、可以設置文本中某些字段為關(guān)鍵字;

2、可以設置文本顏色和其中關(guān)鍵字的顏色;

3、可以設置文本下劃線樣式和其中關(guān)鍵字下劃線樣式;

4、可以指定文本字體與大小和其中關(guān)鍵字的字體與大小;

5、可以響應關(guān)鍵字點擊;


說明一下其中的關(guān)鍵類的意義:

CHLabel.h 自定義的控件,繼承自UILabel;

TestViewController.h 是項目的根視圖控制器,其中使用了CHLabel;


下面看代碼:

CHLabel 代碼實現(xiàn):

[cpp] view plaincopyprint?
  • #import?<UIKit/UIKit.h>??
  • #import<CoreText/CoreText.h>??
  • ??
  • typedef?enum??
  • {??
  • ????kCHLabelUnderlineStyleNone?=?0?,??
  • ????kCHLabelUnderlineStyleSingle?,??
  • ????kCHLabelUnderlineStyleThick?,??
  • ????kCHLabelUnderlineStyleDouble???
  • }?CHLabelUnderlineStyle;??
  • ??
  • @protocol?CHLabelDelegate;??
  • @interface?CHLabel?:?UILabel??
  • {??
  • ????NSString??????????????????*_textCH;??????????????//文本??
  • ????UIColor???????????????????*_textColorCH;?????????//文本顏色??
  • ????UIFont????????????????????*_textFontCH;??????????//文本字體??
  • ????CHLabelUnderlineStyle??????_textUnderlineStyle;??//文本下劃線??
  • ??????
  • ????NSString??????????????????*_textKeyWordCH;???????//關(guān)鍵字??
  • ????UIColor???????????????????*_textKeyWordColorCH;??//關(guān)鍵字顏色??
  • ????UIFont????????????????????*_keyWordFontCH;???????//關(guān)鍵字字體??
  • ????CHLabelUnderlineStyle??????_keyWordUnderlineStyle;//關(guān)鍵字下劃線??
  • ??????
  • ????NSMutableArray????????????*_keyWordsCH;??????????//關(guān)鍵字數(shù)組??
  • ????NSMutableAttributedString?*_attributedString;????//屬性字符串??
  • }??
  • ??
  • @property?(nonatomic,???copy)?NSString??????????????????*textCH;??
  • @property?(nonatomic,?retain)?UIColor???????????????????*textColorCH;??
  • @property?(nonatomic,???copy)?NSString??????????????????*textKeyWordCH;??
  • @property?(nonatomic,?retain)?UIColor???????????????????*textKeyWordColorCH;??
  • @property?(nonatomic,?retain)?UIFont????????????????????*textFontCH;??
  • @property?(nonatomic,?retain)?UIFont????????????????????*keyWordFontCH;???
  • @property?(nonatomic,?retain)?NSMutableArray????????????*keyWordsCH;??
  • @property?(nonatomic,?retain)?NSMutableAttributedString?*attributedString;??
  • @property?(nonatomic,?retain)?id<CHLabelDelegate>????????delegate;??
  • ??
  • -?(void)?setText:(NSString?*)?textString?andKeyWord:(NSString?*)?keyWord;??
  • ??
  • -?(void)?setTextColor:(UIColor?*)textColor?andKeyWordColor:(UIColor?*)?keyWordColor;??
  • ??
  • -?(void)?setTextFont:?(UIFont?*)textFont?andKeyWordFont:(UIFont?*)?keyWordFont;??
  • ??
  • -?(void)?setTextUnderlineStyle:?(CHLabelUnderlineStyle)textUnderlineStyle?andKeyWordUnderlineStyle:(CHLabelUnderlineStyle)?keyWordUnderlineStyle;??
  • ??
  • @end??
  • ??
  • @protocol?CHLabelDelegate?<NSObject>??
  • @optional??
  • -?(void)?CHLabel:(CHLabel?*)?chLabel?tapOnKeyWord:(NSString?*)?keyWord;??
  • ??
  • @end??
  • #import?"CHLabel.h"??
  • ??
  • @implementation?CHLabel??
  • ??
  • @synthesize?textCH???????????????=?_textCH;??
  • @synthesize?textColorCH??????????=?_textColorCH;??
  • @synthesize?textKeyWordCH????????=?_textKeyWordCH;??
  • @synthesize?textKeyWordColorCH???=?_textKeyWordColorCH;??
  • @synthesize?textFontCH???????????=?_textFontCH;??
  • @synthesize?keyWordFontCH????????=?_keyWordFontCH;??
  • @synthesize?keyWordsCH???????????=?_keyWordsCH;??
  • @synthesize?attributedString?????=?_attributedString;??
  • @synthesize?delegate;??
  • ??
  • void?safeRelease(id?pointer)??
  • {??
  • ????if?(!pointer)??
  • ????{??
  • ????????[pointer?release];??
  • ????????pointer?=?nil;??
  • ????}??
  • }??
  • ??
  • -?(void)?dealloc??
  • {??
  • ????safeRelease(_textCH);??
  • ????safeRelease(_textColorCH);??
  • ????safeRelease(_textKeyWordCH);??
  • ????safeRelease(_textKeyWordColorCH);??
  • ????safeRelease(_textFontCH);??
  • ????safeRelease(_keyWordFontCH);??
  • ????safeRelease(_keyWordsCH);??
  • ????safeRelease(_attributedString);??
  • ????safeRelease(delegate);??
  • ??????
  • ????[super?dealloc];??
  • }??
  • ??
  • -?(void)?initializtion??
  • {??
  • ????_textKeyWordCH?=?nil;??
  • ????_textKeyWordColorCH?=?nil;??
  • ????_keyWordsCH?=?[[NSMutableArray?alloc]?init];??
  • }??
  • ??
  • -?(id)?init??
  • {??
  • ????if?(self?=?[super?init])??
  • ????{??
  • ????????[self?initializtion];??
  • ????}??
  • ????return?self;??
  • }??
  • ??
  • -?(id)initWithFrame:(CGRect)frame??
  • {??
  • ????if?([super?initWithFrame:frame])??
  • ????{??
  • ????????[self?initializtion];??
  • ????}??
  • ????return?self;??
  • }??
  • ??
  • -?(void)?setText:(NSString?*)?textString?andKeyWord:(NSString?*)?keyWord??
  • {??
  • ????if?(self.text?!=?textString)??
  • ????{??
  • ????????self.text?=?textString;??
  • ????????self.textCH?=?textString;??
  • ????}??
  • ??????
  • ????[self?fetchKeywordRange:keyWord];??
  • }??
  • ??
  • -?(void)?setTextColor:(UIColor?*)textColor?andKeyWordColor:(UIColor?*)?keyWordColor??
  • {??
  • ????self.textColorCH?=?textColor;??
  • ????self.textKeyWordColorCH?=?keyWordColor;??
  • }??
  • ??
  • -?(void)?setTextFont:(UIFont?*)textFont?andKeyWordFont:(UIFont?*)?keyWordFont??
  • {??
  • ????self.textFontCH?=?textFont;??
  • ????self.keyWordFontCH?=?keyWordFont;??
  • }??
  • ??
  • -?(void)?setTextUnderlineStyle:?(CHLabelUnderlineStyle)textUnderlineStyle?andKeyWordUnderlineStyle:(CHLabelUnderlineStyle)?keyWordUnderlineStyle??
  • {??
  • ????_textUnderlineStyle?=?textUnderlineStyle;??
  • ????_keyWordUnderlineStyle?=?keyWordUnderlineStyle;??
  • }??
  • ??
  • -?(void)?fetchKeywordRange:(NSString?*)keyWord??
  • {??
  • ????if?(nil?==?keyWord)?{??
  • ????????return;??
  • ????}??
  • ??????
  • ????NSMutableAttributedString?*mutableAttributedString?=?[[NSMutableAttributedString?alloc]?initWithString:self.text];??
  • ????NSUInteger?count?=?0,?length?=?[mutableAttributedString?length];??
  • ????NSRange?range?=?NSMakeRange(0,?length);??
  • ??????
  • ????count?=?0,?length?=?[mutableAttributedString?length];??
  • ????range?=?NSMakeRange(0,?length);??
  • ??????
  • ????while(range.location?!=?NSNotFound)??
  • ????{??
  • ????????range?=?[[mutableAttributedString?string]?rangeOfString:keyWord?options:0?range:range];??
  • ????????if(range.location?!=?NSNotFound)?{??
  • ?????????
  • ????????????NSValue?*value?=?[NSValue?valueWithRange:range];??
  • ????????????if?(range.length?>?0)?{??
  • ????????????????[self.keyWordsCH?addObject:value];??
  • ????????????}??
  • ??????????????
  • ????????????range?=?NSMakeRange(range.location?+?range.length,?length?-?(range.location?+?range.length));??
  • ????????????count++;??
  • ????????}??
  • ????}??
  • }??
  • ??
  • -?(int)?labelUnderlineType:(CHLabelUnderlineStyle)?lType??
  • {??
  • ????int?underLineType;??
  • ????switch?(lType)?{??
  • ????????case?0:??
  • ????????????underLineType?=?kCTUnderlineStyleNone;??
  • ????????????break;??
  • ????????case?1:??
  • ????????????underLineType?=?kCTUnderlineStyleSingle;??
  • ????????????break;??
  • ????????case?2:??
  • ????????????underLineType?=?kCTUnderlineStyleThick;??
  • ????????????break;??
  • ????????case?3:??
  • ????????????underLineType?=?kCTUnderlineStyleDouble;??
  • ????????????break;??
  • ????????default:??
  • ????????????underLineType?=?kCTUnderlineStyleNone;??
  • ????????????break;??
  • ????}??
  • ??????
  • ????return?underLineType;??
  • }??
  • ??
  • -?(NSAttributedString?*)?richString:(NSString?*)?textString??
  • {??
  • ????int?length?=?[textString?length];??
  • ????if?(self.attributedString)?{??
  • ????????self.attributedString?=?nil;??
  • ????}??
  • ???self.attributedString?=?[[NSMutableAttributedString?alloc]?initWithString:textString];??
  • ????[self.attributedString?addAttribute:(NSString?*)(kCTForegroundColorAttributeName)??
  • ?????????????????????????????value:(id)self.textColorCH.CGColor??
  • ?????????????????????????????range:NSMakeRange(0,?length)];??
  • ??????
  • ????int?numType?=?0;??
  • ????CFNumberRef?cfNum?=?CFNumberCreate(NULL,?kCFNumberIntType,?&numType);??
  • ????[self.attributedString?addAttribute:(NSString?*)kCTLigatureAttributeName??
  • ??????????????????????????????????value:(id)cfNum??
  • ??????????????????????????????????range:NSMakeRange(0,?length)];??
  • ??????
  • ????float?fNum?=3.0;??
  • ????CFNumberRef?cfNum2?=?CFNumberCreate(NULL,?kCFNumberFloatType,?&fNum);??
  • ????[self.attributedString?addAttribute:(NSString?*)(kCTStrokeColorAttributeName)??
  • ??????????????????????????????????value:(id)cfNum2??
  • ??????????????????????????????????range:NSMakeRange(0,?length)];??
  • ??????
  • ????if?(!self.textFontCH)?{??
  • ????????self.textFontCH?=?self.font;??
  • ????}??
  • ????CTFontRef?ctFont?=?CTFontCreateWithName((CFStringRef)self.textFontCH.fontName,?self.textFontCH.pointSize,?NULL);??
  • ????[self.attributedString?addAttribute:(NSString?*)(kCTFontAttributeName)??
  • ??????????????????????????????????value:(id)ctFont??
  • ??????????????????????????????????range:NSMakeRange(0,?length)];??
  • ??????
  • ????int?underLineType?=?[self?labelUnderlineType:_textUnderlineStyle];??
  • ????CFNumberRef?cfUnderLine?=?CFNumberCreate(NULL,?kCTUnderlineStyleThick,?&underLineType);??
  • ????[self.attributedString?addAttribute:(NSString?*)(kCTUnderlineStyleAttributeName)??
  • ??????????????????????????????????value:(id)cfUnderLine??
  • ??????????????????????????????????range:NSMakeRange(0,?length)];??
  • ??????
  • ????if?(self.textKeyWordColorCH?!=?nil)??
  • ????{??
  • ????????for?(NSValue?*value?in?self.keyWordsCH)??
  • ????????{??
  • ????????????NSRange?keyRange?=?[value?rangeValue];??
  • ????????????[self.attributedString?addAttribute:(NSString?*)(kCTForegroundColorAttributeName)??
  • ??????????????????????????????????????????value:(id)self.textKeyWordColorCH.CGColor??
  • ??????????????????????????????????????????range:keyRange];??
  • ??????????????
  • ????????????if?(!self.keyWordFontCH)?{??
  • ????????????????self.keyWordFontCH?=?self.font;??
  • ????????????}??
  • ????????????CTFontRef?ctFont?=?CTFontCreateWithName((CFStringRef)self.keyWordFontCH.fontName,?self.keyWordFontCH.pointSize,?NULL);??
  • ????????????[self.attributedString?addAttribute:(NSString?*)(kCTFontAttributeName)??
  • ??????????????????????????????????????????value:(id)ctFont??
  • ??????????????????????????????????????????range:keyRange];??
  • ??????????????
  • ????????????int?underLineType?=?[self?labelUnderlineType:_keyWordUnderlineStyle];??
  • ????????????CFNumberRef?cfUnderLine?=?CFNumberCreate(NULL,?kCTUnderlineStyleThick,?&underLineType);??
  • ????????????[self.attributedString?addAttribute:(NSString?*)(kCTUnderlineStyleAttributeName)??
  • ??????????????????????????????????????????value:(id)cfUnderLine??
  • ??????????????????????????????????????????range:keyRange];??
  • ??????????????
  • ????????????[self.attributedString?addAttribute:@"option"?value:[[self.attributedString?string]?substringWithRange:keyRange]?range:keyRange];//彈出alert時候需要??
  • ????????}??
  • ????}??
  • ??????
  • ????return?[[self.attributedString?copy]?autorelease];??
  • }??
  • ??
  • -?(void)?drawRect:(CGRect)rect??
  • {??
  • ????CGContextRef?context?=?UIGraphicsGetCurrentContext();??
  • ????CGContextSaveGState(context);??
  • ????CGContextConcatCTM(context,?CGAffineTransformScale(CGAffineTransformMakeTranslation(0,?rect.size.height+6.5),?1.f,?-1.f));??
  • ??????
  • ????CGContextSetTextPosition(context,?0.0,?0.0);??
  • ????CTFramesetterRef?framesetter?=?CTFramesetterCreateWithAttributedString((CFAttributedStringRef)?[self?richString:self.text]);??
  • ??????
  • //????NSLog(@"AttributedString:%@",?[self?richString:self.text?font:self.font]);??
  • ??????
  • ????CGMutablePathRef?leftColumnPath?=?CGPathCreateMutable();??
  • ????CGPathAddRect(leftColumnPath,?NULL,?rect);??
  • ????CTFrameRef?leftFrame?=?CTFramesetterCreateFrame(framesetter,?CFRangeMake(0,?0),?leftColumnPath,?NULL);??
  • ????CTFrameDraw(leftFrame,?context);??
  • ????CGContextRestoreGState(context);??
  • ????CGPathRelease(leftColumnPath);??
  • ????CFRelease(framesetter);??
  • }??
  • ??
  • -?(void)touchesBegan:(NSSet?*)touches?withEvent:(UIEvent?*)event?{??
  • ??????
  • ????[super?touchesEnded:touches?withEvent:event];??
  • ??????
  • ????CGPoint?tapLocation?=?[[touches?anyObject]?locationInView:self];??
  • ????int?total_height?=?[self?getAttributedStringHeightWithString:self.attributedString?WidthValue:self.frame.size.width];//width為自身寬度??
  • ????//判斷點擊是否超出范圍??
  • ????if?(tapLocation.y?>=?total_height)?{??
  • ????????return;??
  • ????}??
  • ??????
  • ????/**?1.?Setup?CTFramesetter?**/??
  • ????CTFramesetterRef?framesetter?=?CTFramesetterCreateWithAttributedString((CFAttributedStringRef)self.attributedString);??
  • ????/**?2.?Create?CTFrame?**/??
  • ????CGMutablePathRef?path?=?CGPathCreateMutable();??
  • ????CGPathAddRect(path,?NULL,?CGRectMake(0,?0,?self.frame.size.width,?1000));//height越大越好,??
  • ??????
  • ????CTFrameRef?textFrameForKey?=?CTFramesetterCreateFrame(framesetter,?CFRangeMake(0,?0),?path,?NULL);??
  • ????//[self?drawFrame:textFrameForKey?inContext:nil?forString:nil];??
  • ????CFRelease?(path);??
  • ????CFRelease?(framesetter);??
  • ????//CTFrameGetLineOrigins??
  • ????NSArray?*linesArray?=?(NSArray?*)?CTFrameGetLines(textFrameForKey);??
  • ??????
  • ????CGPoint?origins[[linesArray?count]];??
  • ????CTFrameGetLineOrigins(textFrameForKey,?CFRangeMake(0,?0),?origins);??
  • ????CFArrayRef?lines?=?CTFrameGetLines(textFrameForKey);??
  • ??????
  • ????CGFloat?ascent;??
  • ????CGFloat?descent;??
  • ????CGFloat?leading;??
  • ??????
  • ????CTLineRef?line?=?(CTLineRef)?[linesArray?objectAtIndex:0];??
  • ????CTLineGetTypographicBounds(line,?&ascent,?&descent,?&leading);??
  • ??????
  • ????//CFIndex?linesCount?=?CFArrayGetCount(lines);??
  • ??????
  • ????int?line_y?=?1000-?(int)origins[0].y;??//第一行l(wèi)ine的原點y坐標??
  • ????int?line_height?=?line_y?+?(int)descent?+1;?//每行的高度??
  • ??????
  • ????int?current_line?=?tapLocation.y/line_height;??
  • ??????
  • ????CFIndex?curentIndex?=?CTLineGetStringIndexForPosition((CTLineRef)CFArrayGetValueAtIndex(lines,?current_line),tapLocation);??
  • ??????
  • ????//判斷超出范圍??
  • ????if?(curentIndex?>[self.attributedString?length])?{??
  • ????????return;??
  • ????}??
  • ??????
  • ????NSRange?currentRange?=?NSMakeRange(0,?[self.attributedString?length]);??
  • ????//curentIndex??
  • ????NSDictionary?*dic?=?[self.attributedString?attributesAtIndex:curentIndex-1?effectiveRange:¤tRange];??
  • ????id?option?=?[dic?valueForKey:@"option"];??
  • ??????
  • ????if?(option)?{??
  • ???????
  • ????????if?([delegate?respondsToSelector:@selector(CHLabel:tapOnKeyWord:)])??
  • ????????{??
  • ????????????[delegate?CHLabel:self?tapOnKeyWord:(NSString?*)[dic?valueForKey:@"option"]];??
  • ????????}??
  • ????}??
  • }??
  • ??
  • //獲取coretext高度??
  • -?(int)getAttributedStringHeightWithString:(NSAttributedString?*)string??WidthValue:(int)?width??
  • {??
  • ????int?total_height?=?0;??
  • ??????
  • ????//string?為要計算高度的NSAttributedString??
  • ????CTFramesetterRef?framesetter?=?CTFramesetterCreateWithAttributedString((CFAttributedStringRef)string);??
  • ??????
  • ????CGRect?drawingRect?=?CGRectMake(0,?0,?width,?1000);??//這里的高要設置足夠大??
  • ????CGMutablePathRef?path?=?CGPathCreateMutable();??
  • ????CGPathAddRect(path,?NULL,?drawingRect);??
  • ????CTFrameRef?textFrame?=?CTFramesetterCreateFrame(framesetter,CFRangeMake(0,0),?path,?NULL);??
  • ????CGPathRelease(path);??
  • ????CFRelease(framesetter);??
  • ??????
  • ????NSArray?*linesArray?=?(NSArray?*)?CTFrameGetLines(textFrame);??
  • ??????
  • ????CGPoint?origins[[linesArray?count]];??
  • ????CTFrameGetLineOrigins(textFrame,?CFRangeMake(0,?0),?origins);??
  • ??????
  • ????int?line_y?=?(int)?origins[[linesArray?count]?-1].y;??//最后一行l(wèi)ine的原點y坐標??
  • ??????
  • ????CGFloat?ascent;??
  • ????CGFloat?descent;??
  • ????CGFloat?leading;??
  • ??????
  • ????CTLineRef?line?=?(CTLineRef)?[linesArray?objectAtIndex:[linesArray?count]-1];??
  • ????CTLineGetTypographicBounds(line,?&ascent,?&descent,?&leading);??
  • ??????
  • ????total_height?=?1000?-?line_y?+?(int)?descent?+1;????//+1為了糾正descent轉(zhuǎn)換成int小數(shù)點后舍去的值??
  • ??????
  • ????CFRelease(textFrame);??
  • ??????
  • ????return?total_height;??
  • }??
  • ??
  • @end??
  • ??
  • ??
  • TestViewController.h?代碼實現(xiàn):??
  • @interface?TestViewController?:?UIViewController?<CHLabelDelegate>??
  • {??
  • ????IBOutlet?UITextField?*textString;??
  • ????IBOutlet?UITextField?*keyString;??
  • }??
  • ??
  • -?(IBAction)?showText:(id)sender;??
  • ??
  • @end??
  • ??
  • #import?"TestViewController.h"??
  • ??
  • @interface?TestViewController?()??
  • ??
  • @end??
  • ??
  • @implementation?TestViewController??
  • ??
  • -?(id)initWithNibName:(NSString?*)nibNameOrNil?bundle:(NSBundle?*)nibBundleOrNil??
  • {??
  • ????self?=?[super?initWithNibName:nibNameOrNil?bundle:nibBundleOrNil];??
  • ????if?(self)?{??
  • ????????//?Custom?initialization??
  • ????}??
  • ????return?self;??
  • }??
  • ??
  • -?(IBAction)?showText:(id)sender??
  • {??
  • ????[textString?resignFirstResponder];??
  • ????[keyString?resignFirstResponder];??
  • ??????
  • ????CHLabel?*label?=?[[CHLabel?alloc]?initWithFrame:CGRectMake(10,?260,?300,?200)];??
  • ??????
  • ????[label?setUserInteractionEnabled:YES];??
  • ????[label?setText:textString.text?andKeyWord:keyString.text];??
  • ????[label?setTextColor:[UIColor?redColor]?andKeyWordColor:[UIColor?blueColor]];??
  • ????[label?setTextUnderlineStyle:kCHLabelUnderlineStyleSingle?andKeyWordUnderlineStyle:kCHLabelUnderlineStyleDouble];??
  • ????[label?setTextFont:[UIFont?systemFontOfSize:20]?andKeyWordFont:[UIFont?boldSystemFontOfSize:30]];??
  • ????label.backgroundColor?=?[UIColor?lightGrayColor];??
  • ????[label?setNumberOfLines:0];??
  • ????label.delegate?=?self;??
  • ??????
  • ??????
  • ????NSArray?*fontArray?=?[UIFont?familyNames];??
  • ????NSString?*fontName;??
  • ????if?([fontArray?count])?{??
  • ????????fontName?=?[fontArray?objectAtIndex:0];??
  • ????}??
  • ????[label?setFont:[UIFont?fontWithName:fontName?size:20]];??
  • ??????
  • ????[self.view?addSubview:label];??
  • //????[label?setNeedsDisplay];??
  • ????[label?release];??
  • }??
  • ??
  • -?(void)viewDidLoad??
  • {??
  • ????[super?viewDidLoad];??
  • }??
  • ??
  • -?(void)didReceiveMemoryWarning??
  • {??
  • ????[super?didReceiveMemoryWarning];??
  • }??
  • ??
  • #pragma?mark?CHLabelDelegate??
  • -?(void)?CHLabel:(CHLabel?*)?chLabel?tapOnKeyWord:(NSString?*)?keyWord??
  • {??
  • ????UIAlertView?*alert?=?[[UIAlertView?alloc]?initWithTitle:@"notice"??
  • ????????????????????????????????????????????????????message:[NSString?stringWithFormat:@"Tap?on?keyWord:%@",?keyWord]??
  • ???????????????????????????????????????????????????delegate:nil??
  • ??????????????????????????????????????????cancelButtonTitle:@"OK"??
  • ??????????????????????????????????????????otherButtonTitles:nil];??
  • ????[alert?show];??
  • ????[alert?release];??



  • }



    完整的項目鏈接:http://pan.baidu.com/share/link?shareid=362100&uk=3674861929

    轉(zhuǎn)載請保留,原文鏈接:http://blog.csdn.net/zfpp25_/article/details/8639215

    若發(fā)現(xiàn)有不合適或錯誤之處,還請批評指正,不勝感激。

    總結(jié)

    以上是生活随笔為你收集整理的CoreText入门的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。