码迷,mamicode.com
首页 >  
搜索关键字:alloc    ( 3259个结果
事件加不上的另一种原因
UIImageView *v = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, _msg.contentF.size.width, _msg.contentF.size.height)]; [v setImageWithURL:[N...
分类:其他好文   时间:2014-05-16 23:11:08    阅读次数:271
UITableView下拉导致数组被释放crash
问题:数组用的[NSArray arrayWithObjectsAndkeys....]方法创建,下拉后crash。调试:断点调试发现,下拉后数组被清空。解决方案:用alloc的方法创建数组,在dealloc里释放内存,OK。
分类:其他好文   时间:2014-05-16 21:31:05    阅读次数:262
iOS tabbar 控制器基本使用
RootViewController *rootVC=[[RootViewController alloc] init] SignInViewController *signVC = [[SignInViewController alloc]init]; //如果在这里指定ta...
分类:移动开发   时间:2014-05-16 07:02:10    阅读次数:396
iOS地图及定位功能基本实现的详尽描述
首先创建一个viewController:一、添加地图1、添加MapKit,CoreLocation框架2、初始化地图视图:@property (nonatomic, strong) MKMapView *mapView; self.mapView =[[MKMapView alloc]initW....
分类:移动开发   时间:2014-05-15 17:28:10    阅读次数:348
ios 控制器 modal 学习
代码创建: 1、appdelegate 把contoller放到跟controller下 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWi...
分类:移动开发   时间:2014-05-15 14:57:06    阅读次数:456
IOS 函数内 autorelease release
在一个有reurn 返回值的函数里 如果申请了一段内存的话(alloc 或者copy) 这个时候不能够release  只能够使用autorelease 在返回到那个被接受到的指针里,由它去进行释放!! 如果是self.obj(或者某些类对应的   SomeClass.obj)这种类型的,就需要把self.去掉(因为这样子的申请出来的内存引用计数会被retain+1了) ...
分类:移动开发   时间:2014-05-15 04:40:44    阅读次数:369
UITabBarController 初学
纯代码编写UITabBarController, 不多说,直接见代码RViewController1 *vc1 = [[RViewController1 alloc]init]; UINavigationController *navController = [[UINavigatio...
分类:其他好文   时间:2014-05-15 02:16:10    阅读次数:246
关联容器 — hash_map
hash_map和map的用法很相似,只是底层机制有所不同。 hash_map容器采用的底层机制是hash table代码: template , class EqualKey = equal_to, class Alloc = alloc> class hash_map { private: typedef hashtable, Key...
分类:其他好文   时间:2014-05-13 22:59:23    阅读次数:256
UIDatePicker的简单用法
// 初始化UIDatePickerUIDatePicker *datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 200, 320, 216)];//设置时区[datePickersetTimeZone:[NSTimeZon...
分类:其他好文   时间:2014-05-12 20:36:23    阅读次数:272
NSDateFormatter相关整理
//实例化一个NSDateFormatter对象NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];//设定时间格式,这里可以设置成自己需要的格式[dateFormatter setDateFormatter:@"yyyy-M...
分类:其他好文   时间:2014-05-12 20:30:13    阅读次数:306
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!