随笔分类 -  iOS

摘要:给同一种类型的block定义一个别名typedef int (^MyBlock) (int , int); int main(int argc, const char * argv[]) { @autoreleasepool { MyBlock sumBlock = ^(int ... 阅读全文
posted @ 2015-04-07 19:07 嗷大喵 阅读(327) 评论(0) 推荐(0)
摘要://gcd的定时器timer必须先保存为一个属性或者成员变量@property (nonatomic , assign) dispatch_source_t timer; //第一种 每一秒执行一次(重复性) double delayInSeconds = 1.0; //每间隔... 阅读全文
posted @ 2015-04-07 19:03 嗷大喵 阅读(349) 评论(0) 推荐(0)
摘要:最近使用CocoaPods来添加第三方类库,无论是执行pod install还是pod update都卡在了Analyzing dependencies不动原因在于当执行以上两个命令的时候会升级CocoaPods的spec仓库,加一个参数可以省略这一步,然后速度就会提升不少。加参数的命令如下:pod... 阅读全文
posted @ 2015-04-07 18:58 嗷大喵 阅读(374) 评论(0) 推荐(0)
摘要://设置导航栏baritem和返回baiitem样式UIBarButtonItem *barItem = [UIBarButtonItem appearance];//去掉返回按钮上的字[barItem setBackButtonTitlePositionAdjustment:UIOffsetMak... 阅读全文
posted @ 2015-04-07 18:51 嗷大喵 阅读(1090) 评论(0) 推荐(0)
摘要:IAPHelper.h//// IAPHelper.h// airplay//// Created by apple on 13-10-23.// Copyright (c) 2013年 itcast. All rights reserved.//#import typedef void (... 阅读全文
posted @ 2015-04-05 19:31 嗷大喵 阅读(732) 评论(0) 推荐(0)
摘要:_loginBtn = [[UIButton alloc]initWithFrame:CGRectMake(iconX, CGRectGetMaxY(passwordBGView.frame)+25, 280, 35)];[_loginBtn setTitle:@"进入游戏\nSTART GAME"... 阅读全文
posted @ 2015-04-05 19:21 嗷大喵 阅读(1633) 评论(0) 推荐(0)
摘要:-(void)upload{ AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; NSDictionary *params = @{@"deviceName":@"imageN... 阅读全文
posted @ 2015-04-05 19:18 嗷大喵 阅读(414) 评论(0) 推荐(0)
摘要:解决方式1:self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.tableView.bounds.size.width, 0.01f)];解决方式2:self.table... 阅读全文
posted @ 2015-04-05 19:16 嗷大喵 阅读(729) 评论(0) 推荐(0)
摘要://通常用于删除缓存的时,计算缓存大小//单个文件的大小- (long long) fileSizeAtPath:(NSString*) filePath{ NSFileManager* manager = [NSFileManager defaultManager]; if ([man... 阅读全文
posted @ 2015-04-05 19:15 嗷大喵 阅读(2565) 评论(0) 推荐(0)
摘要:一,x264库的编译 首先到http://www.videolan.org/developers/x264.html下载x264的库,然后解压,修改文件夹名称为x264 二,下载ffmpeg2.x http://ffmpeg.org/releases/ 例如:http://ffmpeg.org/re 阅读全文
posted @ 2015-04-05 19:09 嗷大喵 阅读(238) 评论(0) 推荐(0)
摘要:1.不要同时开太多的线程(1~3条线程即可,不要超过5条)2.线程概念1> 主线程 : UI线程,显示、刷新UI界面,处理UI控件的事件2> 子线程 : 后台线程,异步线程3.不要把耗时的操作放在主线程,要放在子线程中执行一、NSThread(掌握)1.创建和启动线程的3种方式1> 先创建,后启动/... 阅读全文
posted @ 2015-04-05 10:40 嗷大喵 阅读(443) 评论(0) 推荐(0)
摘要:extern(外部)1.对函数 完整的定义一个外部函数(可以省略extern) 完整的声明一个外部函数(可以省略extern)2.对变量 只能声明一个外部变量(不能省略extern) 在函数里面定义extern的变量表示应用程序中其他地方的变量(引用某个全局变量,并非定义)static(内部... 阅读全文
posted @ 2015-04-05 10:25 嗷大喵 阅读(1082) 评论(0) 推荐(0)