会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
罕见
博客园
首页
新随笔
联系
订阅
管理
2015年11月12日
NSString 去掉前后空格或回车符
摘要: NSString *string = @" spaces in front and at the end ";NSString *trimmedString = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAnd...
阅读全文
posted @ 2015-11-12 10:31 罕见
阅读(469)
评论(0)
推荐(0)
2015年10月10日
Objective-C 计算代码运行时间
摘要: 今天看到一篇关于iOS应用性能优化的文章,其中提到计算代码的运行时间,觉得非常有用,值得收藏。不过在模拟器和真机上是有差异的,以此方法观察程序运行状态,提高效率。第一种:(最简单的NSDate)NSDate* tmpStartData = [NSDate date];//You code here....
阅读全文
posted @ 2015-10-10 11:51 罕见
阅读(860)
评论(0)
推荐(0)
2015年7月30日
如何从uiview里面,获取其上层的uiviewcontroller
摘要: id object = [self nextResponder]; while (![object isKindOfClass:[UIViewController class]] &&object != nil) { object = [object nextResponder]; } ...
阅读全文
posted @ 2015-07-30 14:08 罕见
阅读(289)
评论(0)
推荐(0)
2015年7月8日
tableView点击后取消选中效果
摘要: [self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES];
阅读全文
posted @ 2015-07-08 11:51 罕见
阅读(1086)
评论(0)
推荐(0)
2015年6月4日
UIView常用的一些方法小记之setNeedsDisplay和setNeedsLayout
摘要: 1,UIView的setNeedsDisplay和setNeedsLayout方法首先两个方法都是异步执行的。而setNeedsDisplay会调用自动调用drawRect方法,这样可以拿到 UIGraphicsGetCurrentContext,就可以画画了。而setNeedsLayout会默认调...
阅读全文
posted @ 2015-06-04 10:49 罕见
阅读(122)
评论(0)
推荐(0)
2015年6月1日
根据文字计算Label的尺寸
摘要: CGSize size = [self.username.text boundingRectWithSize:(CGSize){130,20} options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName...
阅读全文
posted @ 2015-06-01 16:57 罕见
阅读(186)
评论(0)
推荐(0)
2015年5月27日
NSDate简单的使用
摘要: NSDateFormatter *dateFormtter=[[NSDateFormatter alloc] init]; [dateFormtter setDateFormat:@"yyyy-MM-dd"]; NSString *dateString=[dateFormtter string...
阅读全文
posted @ 2015-05-27 16:18 罕见
阅读(128)
评论(0)
推荐(0)
2015年5月25日
iOS AVAudioPlayer 提示音
摘要: NSString *urlPath = [[NSBundle mainBundle] pathForResource:@"" ofType:@""];NSURL *url = [NSURL fileURLWithPath:urlPath];self.player = [[AVAudioPlayer ...
阅读全文
posted @ 2015-05-25 15:18 罕见
阅读(143)
评论(0)
推荐(0)
2015年5月21日
裁减图片
摘要: [_postNewTopicBtn.imageView.layer setCornerRadius:20];[_postNewTopicBtn.imageView.layer setMasksToBounds:YES];
阅读全文
posted @ 2015-05-21 18:11 罕见
阅读(142)
评论(0)
推荐(0)
2015年5月15日
根据identifier从StoryBoard中获取对象,UIButton的图片文件位置
摘要: - (id)readViewControllerFromStoryBoardWithIdentifier:(NSString *)identifier{ return [[UIStoryboard storyboardWithName:@"ELVStoryBoard" bundle:nil] in...
阅读全文
posted @ 2015-05-15 17:37 罕见
阅读(403)
评论(0)
推荐(0)
下一页
公告