随笔分类 - 其他
摘要:In iOS 7 and later, if you ask for the MAC address of an iOS device, the system returns the value 02:00:00:00:00:00. If you need to identify the device, use the identifierForVendor property of UIDevice instead. (Apps that need an identifier for their own advertising purposes should consider using th
阅读全文
摘要:if (content) { CGSize constraint = CGSizeMake(self.contentWide, CGFLOAT_MAX); CGSize size = [content sizeWithFont:contentFont constrainedToSize:constraint lineBreakMode:UILineBreakModeWordWrap]; frame = CGRectMake(self.contentX, y, self.contentWide, size.height+16); UITextView *textView = [[UITextV.
阅读全文
摘要:http://bugfix.lofter.com/post/b071_13117b
阅读全文
摘要:由于padding 的原因出现这个问题。因此即使减16 再返回的高度上加16还是不怎么准确。因此根据UITextView 的contentSize 的height 计算比较准确
阅读全文
摘要:http://stackoverflow.com/questions/5932397/the-class-is-not-key-value-coding-compliant-for-the-key
阅读全文
摘要:NSString * regexPassword = @"^.{6,}$"; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regexPassword]; if (![predicate evaluateWithObject:self.password.text]||![predicate evaluateWithObject:self.againPassWord.text]||![predicate evaluateWithObject:sel
阅读全文
摘要:// NSString *iTunesLink = [NSString stringWithFormat:@"https://itunes.apple.com/cn/app/%@/id%d?mt=8",APPNAME,APPID];// [[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]]; NSString *iTunesLink = [NSString stringWithFormat:@"https://itunes.apple.com/cn/app/id&q
阅读全文
摘要:在程序中加载ttf文件首先要解决的问题,是在程序中加载.ttf/otf文件。我们在示例程序的资源束中加入了一个“方正大黑简体.ttf”的文件。这个文件是我从Mac系统中搜索到的,应该是MicrosoftOffice中提供的字体文件。我们用以下代码来加载它:NSString *fontPath = [[NSBundlemainBundle] pathForResource:@"方正大黑简体" ofType:@"ttf"];CGDataProviderReffontDataProvider = CGDataProviderCreateWithFilename
阅读全文