1.UILabel在使用attributedText属性后,若还需要使其在末尾显示省略号,则需要在给attributedText属性赋值之后,重新给LineBreakMode赋值
2.attributedString在设置缩进后,使用boundingRectWithSize:(CGSize)size options:context: 估算高度时,不计入缩进,无法估算准确.
3.汉字(不止中文)转拼音
转自:http://blog.csdn.net/ani_di/article/details/9857539
NSMutableString *ms = [[NSMutableString alloc] initWithString:@"我是中国人"];
if (CFStringTransform((__bridge CFMutableStringRef)ms, 0, kCFStringTransformMandarinLatin, NO)) {
NSLog(@"Pingying: %@", ms); // wǒ shì zhōng guó rén
}
if (CFStringTransform((__bridge CFMutableStringRef)ms, 0, kCFStringTransformStripDiacritics, NO)) {
NSLog(@"Pingying: %@", ms); // wo shi zhong guo ren
}
4.XCode的UserData文件夹路径
~/Library/Developer/Xcode/UserData/
5.XCode模板存放路径
/Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates
6.Provisioning Profile 存放路径
~/Library/MobileDevice/Provisioning Profiles
6.UITableView的坑.
UITableView,UICollectionView 判断用户是否拖拽.isDragging属性无效.需用isTracking替代.
7.侧边右滑返回失效.(情景:内嵌webView等VC)
viewDidLoad 中重设:
8.iPad上出现视图向内集中(例:tableview的分割线左边距加大).是由于layoutMargins造成.
9.pod push到私有库之后, 需要重新创建搜索索引, 才可以pod search到.
rm ~/Library/Caches/CocoaPods/search_index.json
10. iOS 11 中 UITableView contentOffset 可能设置无效。
// 关闭预估高度,防止iOS 11 下, 设置contentOffset 无效
self.tableView.estimatedRowHeight = 0;
self.tableView.estimatedSectionHeaderHeight = 0;
self.tableView.estimatedSectionFooterHeight = 0;