码迷,mamicode.com
首页 >  
搜索关键字:alloc    ( 3259个结果
iOS 拨打电话三种方式
1 1,这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示 2 NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"]; 3 // NSLog(@"... ...
分类:移动开发   时间:2017-09-01 19:35:51    阅读次数:223
iOS的内存管理
最近看了两本书,《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
oc42--引用计数器
/* main.m 堆里面的内存释放是根据引用计数器,所以就是操作引用计数器。 创建一个对象,对象里面就有一个引用计数器,有多少指针指向它。 引用计数器为0就释放。任何一个对象初始化时就是1,所以 { Person *p = [[Person alloc] init] } 出了这行代码p销毁了,但是... ...
分类:其他好文   时间:2017-08-23 17:39:05    阅读次数:187
ios遮罩层的简单使用
/** 大图 */ - (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 加速器陀螺仪
初始化CoreMotion #import <CoreMotion/CoreMotion.h> CMMotionManager *motionManager = [[CMMotionManager alloc]init]; 1. Accelerometer 获取手机加速度数据 CMAccelerom ...
分类:其他好文   时间:2017-08-21 16:35:10    阅读次数:208
关于UITabBarController的设置(iOS 开发)
1.设置图片(选中以及未选中) UITabBarItem *TuiJianItem=[[UITabBarItem alloc]initWithTitle:@"我的" image:[[UIImage imageNamed:@"index_bottom07_"] imageWithRenderingMo ...
分类:移动开发   时间:2017-08-21 15:48:31    阅读次数:211
多线程开发之NSThrea
创建并启动 先创建线程,再启动 // 创建 NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(run:) object:nil]; // 启动 [thread start]; 创建并启动 [NSTh ...
分类:编程语言   时间:2017-08-12 15:22:51    阅读次数:176
实战c++中的vector系列--构造、operator=和assign差别
vector或许是实际过程中使用最多的stl容器。看似简单,事实上有非常多技巧和陷阱。 着重看一看vector的构造,临时依照C++11: default (1) explicit vector (const allocator_type& alloc = allocator_type()); fi ...
分类:编程语言   时间:2017-08-10 13:20:43    阅读次数:282
UI_UITabBarController
建立控制器 // 普通控制器 GroupViewController *groupVC = [[GroupViewController alloc] init]; SecondViewController *secondVC = [[SecondViewController alloc] init] ...
分类:其他好文   时间:2017-08-10 11:44:55    阅读次数:113
3259条   上一页 1 ... 16 17 18 19 20 ... 326 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!