- 博客(8)
- 资源 (3)
- 收藏
- 关注
原创 方法延迟执行的调用和取消
// - 对象方法 延迟2秒后调用 self 的 run 方法 [self performSelector:@selector(run) withObject:nil afterDelay:2]; // - 类方法 取消之前调用的 self 的 run 方法 [[self class] cancelPreviousPerformRequestsWithTarget:self
2016-07-25 11:34:16 1422
原创 获取 image 的名字
-(void)change { int randNum = rand() % (4 - 0) + 0; [_imgView setImage:[UIImage imageNamed:[imgArray objectAtIndex:randNum]]]; [_imgView.image setAccessibilityIdentifier:[imgArray objectAt
2016-07-08 18:34:44 5210
原创 字符串格式化显示
NSInteger edanCount = self.edan.integerValue; if (edanCount > 1000000) {/** 鹅蛋数超过 1000000 显示 100万 或者 32.1万*/ if ( edanCount % 10000 == 0) {/** 可以被 10000 整除 显示 100万*/ return
2016-07-07 17:40:01 423
原创 设置 scrllView 上边穿过导航栏 下边穿过 tabba
UIScrollView * scrllView; scrllView.frame = self.view.bounds; scrllView.contentInset = UIEdgeInsetsMake(64, 0, 0, 49); [self.view insertSubview:scrllView atIndex:0];(// - 不用再加到视图控制器的 ve
2016-07-06 23:00:51 507
原创 iOS 消除警告
#pragma clang diagnostic push #pragma clang diagnostic ignored "" #pragma clang diagnostic pop /** * 导航栏的警告(感叹号) -> 警告信息的位置 -> 鼠标右键 -> Reveal in Log 里边的[错误原因](一般是 -WXXXX); */
2016-07-06 22:37:31 558
原创 让按钮底部的指示器的 view 的宽度和按钮里边的文字的宽度相同
/** 按钮的点击事件监听 */ -(void)onButtonClick:(UIButton *)sender{ /** view 是按钮底部的指示器的 view */ view.width = sender.titleLabel.width; }
2016-07-05 18:56:04 448
原创 设置 view 的透明度
self.view.backgroundColor = [[UIColor redColor]colorWithAlphaComponent:0.5];
2016-07-05 18:41:53 1592
原创 字典的基础操作
//添加现有的字典数据 [mutableDic addEntriesFromDictionary:dic3]; NSLog(@"mutableDic :%@",mutableDic); //添加新的键值对象 [mutableDic setValue:@"set1" forKey:@"setKey1"];
2016-07-04 14:53:36 299
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人