IOS???????????????
???????????? ???????[ 2014/9/15 11:16:46 ] ??????????????? iOS ????
????6.??????????????????濪????????????????????????????????????????????У????????????е?λ????????????У?????????????????С????????£?
1 //??????????????д洢???????????????λ??
2 NSMutableArray *imageArray = [NSMutableArray arrayWithCapacity:resultArray.count];
3
4 //???????Χ????????????????滻
5 for(NSTextCheckingResult *match in resultArray) {
6 //???????????е??range
7 NSRange range = [match range];
8
9 //??????????ж?????
10 NSString *subStr = [str substringWithRange:range];
11
12 for (int i = 0; i < face.count; i ++)
13 {
14 if ([face[i][@"chs"] isEqualToString:subStr])
15 {
16
17 //face[i][@"gif"]??????????????
18 //??????????????????????
19 NSTextAttachment *textAttachment = [[NSTextAttachment alloc] init];
20
21 //???????????
22 textAttachment.image = [UIImage imageNamed:face[i][@"png"]];
23
24 //????????????????????????滻?????????е????????
25 NSAttributedString *imageStr = [NSAttributedString attributedStringWithAttachment:textAttachment];
26
27 //?????????????λ??????????
28 NSMutableDictionary *imageDic = [NSMutableDictionary dictionaryWithCapacity:2];
29 [imageDic setObject:imageStr forKey:@"image"];
30 [imageDic setObject:[NSValue valueWithRange:range] forKey:@"range"];
31
32 //??????????????
33 [imageArray addObject:imageDic];
34
35 }
36 }
37 }
????7.????????????????attributeString?????滻???滻?????????????滻????????????滻???????range????????λ?ò??????????滻???????£?
1 //???????滻
2 for (int i = imageArray.count -1; i >= 0; i--)
3 {
4 NSRange range;
5 [imageArray[i][@"range"] getValue:&range];
6 //?????滻
7 [attributeString replaceCharactersInRange:range withAttributedString:imageArray[i][@"image"]];
8
9 }
????8.???滻??????????????????TextView
????1 //???滻?????????????TextView
????2 self.myTextView.attributedText = attributeString;
????9.?滻???Ч?????£?
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???ios???????????????Щ????IOS???á?????豸?????TestAgent??????????????????MR????ν???IOS?豸???????????????????????MobileRunner iOS???????iOS???????iOS???????????? ???????????iOS??JSON?????????????iOS UnitTest?????????iOS?????????????6С???BugAppium iOS 10 ????????iOS???????iOS UI???????????iOS APP????????????????????????????????ν???iOS????????????????iOS?湫?????????????????????????????????????iOS???????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????