码迷,mamicode.com
首页 >  
搜索关键字:alloc    ( 3259个结果
AppDelegate 里一个基本的跳转方法,用来在rootView崩溃的时候直接调试我自己的页面
将- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.window = [[UIWindow alloc] init...
分类:移动开发   时间:2014-10-15 11:47:40    阅读次数:216
3种拨打电话的方式
小弟查了很多地方的关于iOS程序拨打电话,大都不全,今天我总结了三种方法,各有不同,拿来给大家分享,希望给大家有所帮助1,这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示NSMutableString * str=[[NSMutableString alloc] i...
分类:其他好文   时间:2014-10-15 09:16:10    阅读次数:184
ARC中strong、weak、unsafe_unretained的区别
第一、strong关键字与retain关似,用了它,引用计数自动+1 如果person定义如下: @interface Person : NSObject @property(nonatomic,strong)Book *book1; @end @autoreleasepool { p1=[[Person alloc] init]; Book *book...
分类:其他好文   时间:2014-10-14 19:57:39    阅读次数:207
ios UI实现技巧
statusBar 移动位置NSString *key = [[NSString alloc] initWithData:[NSData dataWithBytes:(unsigned char []){0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x61, ...
分类:移动开发   时间:2014-10-14 16:03:28    阅读次数:287
ios不可改变NSString类和可改变NSMutableString类的使用
一,NSString的常用用法1,创建对象两种方法1)”-”号方法alloc+初始化initWithStringNSString*str=[[NSStringalloc]initWithString:@"iPhone4"];initWithFormat这种方法比initWithString更强大可以设置格式,如上述的字符串”iPhone4”可以写成NSString*str=[[NSStringalloc]init..
分类:移动开发   时间:2014-10-14 04:16:38    阅读次数:221
IOS是否在项目中存在,所使用的反射那点事
NSClassFromString,NSSelectorFromString,isKingOfClass 1. NSClassFromString   这个方法判断类是否存在,如果存在就动态加载的,不存为就返回一个空对象;   id myObj = [[NSClassFromString(@"MySpecialClass") alloc] init];   正常情况下等...
分类:移动开发   时间:2014-10-13 20:16:27    阅读次数:187
UI: 使用 UITextField 接收用户文本输入
代码:1.简单地添加了一个textFieldCGRect textFieldFrame = CGRectMake(0, 0, 200, 31); _myTextField = [[UITextField alloc]initWithFrame:textFieldFrame]; _myTe...
分类:其他好文   时间:2014-10-13 17:04:39    阅读次数:147
iOS :UINavigationController
1,创建并使用一个UINavigationControllerUIViewController *vc = [[UIViewController alloc]init];UINavigationController *nav = [[UINavigationController alloc] ini...
分类:移动开发   时间:2014-10-12 00:52:47    阅读次数:326
iOS开发- UILabel 自动换行 及 高度自适应
主要是今天看到论坛有人问这个问题,帮忙解决之后, 顺便Mark下。很简单, 代码写的很清楚。 直接上代码。UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 100, 300, 50)]; label.text = @"今天下午全市多云到阴有阵雨或雷雨,今天夜里到明天阴有阵雨,雨量可达大雨。 东北风5-6级阵风7级,...
分类:移动开发   时间:2014-10-11 17:21:36    阅读次数:243
iOS8中定位服务的变化(CLLocationManager协议方法不响应,无法回掉GPS方法,不出现获取权限提示)
最近在写一个LBS的项目的时候,因为考虑到适配iOS8,就将项目迁移到Xcode6.0.1上,出现了不能正常获取定位服务权限的问题。self.manger = [[CLLocationManager alloc]init];self.manger.distanceFilter = kCLDistan...
分类:移动开发   时间:2014-10-11 15:22:45    阅读次数:163
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!