1 1,这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示 2 NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"]; 3 // NSLog(@"... ...
分类:
移动开发 时间:
2017-09-01 19:35:51
阅读次数:
223
最近看了两本书,《Objective-C 高级编程,iOS与OS X多线程和内存管理》,《Effective Object-C2.0》。iOS开发必看的两本书,非常推荐。但是看内存管理的时候有一句话非常不理解:自己生成并持有对象,引用计数为1。后面还有一句:对象alloc的时候默认引用计数为1。自己 ...
分类:
移动开发 时间:
2017-08-31 16:18:40
阅读次数:
212
NSDate *date = [NSDate date]; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateStyle:NSDateFormatterMediumStyle]; ... ...
分类:
其他好文 时间:
2017-08-26 15:03:11
阅读次数:
111
/* main.m 堆里面的内存释放是根据引用计数器,所以就是操作引用计数器。 创建一个对象,对象里面就有一个引用计数器,有多少指针指向它。 引用计数器为0就释放。任何一个对象初始化时就是1,所以 { Person *p = [[Person alloc] init] } 出了这行代码p销毁了,但是... ...
分类:
其他好文 时间:
2017-08-23 17:39:05
阅读次数:
187
/** 大图 */ - (IBAction)bigImg { //1.添加按钮遮罩层 UIButton *cover=[[UIButton alloc] init]; cover.frame=self.view.bounds; cover.backgroundColor=[UIColor black... ...
分类:
移动开发 时间:
2017-08-23 10:36:14
阅读次数:
297
初始化CoreMotion #import <CoreMotion/CoreMotion.h> CMMotionManager *motionManager = [[CMMotionManager alloc]init]; 1. Accelerometer 获取手机加速度数据 CMAccelerom ...
分类:
其他好文 时间:
2017-08-21 16:35:10
阅读次数:
208
1.设置图片(选中以及未选中) UITabBarItem *TuiJianItem=[[UITabBarItem alloc]initWithTitle:@"我的" image:[[UIImage imageNamed:@"index_bottom07_"] imageWithRenderingMo ...
分类:
移动开发 时间:
2017-08-21 15:48:31
阅读次数:
211
创建并启动 先创建线程,再启动 // 创建 NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(run:) object:nil]; // 启动 [thread start]; 创建并启动 [NSTh ...
分类:
编程语言 时间:
2017-08-12 15:22:51
阅读次数:
176
vector或许是实际过程中使用最多的stl容器。看似简单,事实上有非常多技巧和陷阱。 着重看一看vector的构造,临时依照C++11: default (1) explicit vector (const allocator_type& alloc = allocator_type()); fi ...
分类:
编程语言 时间:
2017-08-10 13:20:43
阅读次数:
282
建立控制器 // 普通控制器 GroupViewController *groupVC = [[GroupViewController alloc] init]; SecondViewController *secondVC = [[SecondViewController alloc] init] ...
分类:
其他好文 时间:
2017-08-10 11:44:55
阅读次数:
113