上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页
摘要: 1 CGSize height = self.view.bounds.size.height; 2 CGSize width = self.view.bounds.size.width; 3 CGFloat height = self.bounds.size.height; 4 CGFloat weight = self.bounds.size.width; 5 6 // 设置文字居中 7 self.titleLabel.textAlignment = NSTextAlignmentCenter; 8 // 设置字体大小 9 self.titleLabel.font = [UIFont s.. 阅读全文
posted @ 2013-08-02 10:57 wangzhenxiang 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 1 //主屏幕设为webView2 CGRect frame = [UIScreen mainScreen].applicationFrame;3 UIWebView *webView = [[[UIWebView alloc] initWithFrame:frame] autorelease];4 self.view = webView;1 UIApplication *app = [UIApplication sharedApplication];2 // 显示状态栏3 app.statusBarHidden = NO;4 ChangeController *index = [[Chan. 阅读全文
posted @ 2013-08-02 01:59 wangzhenxiang 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 1 id key = (id)kCFBundleVersionKey; 2 // 检测是否第一次使用这个版本 info.plist 3 NSDictionary *info = [NSBundle mainBundle].infoDictionary; 4 NSString *currentVersion = [info objectForKey:key]; 5 6 // NSLog(@"%@", currentVersion); 7 8 // 从沙盒中取出版本号 9 NSUserDefaults *defaults =[N... 阅读全文
posted @ 2013-08-02 00:59 wangzhenxiang 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 1 -(IBAction)btnClick{ 2 UIActionSheet* actionSheet = [[UIActionSheet alloc] 3 initWithTitle:nil 4 delegate:self 5 cancelButtonTitle:@"取消" 6 destructiveButtonTitle:... 阅读全文
posted @ 2013-08-01 19:02 wangzhenxiang 阅读(456) 评论(0) 推荐(0) 编辑
摘要: //上拉菜单 1 UIActionSheet* sheet = [[UIActionSheet alloc] 2 initWithTitle:nil 3 delegate:self 4 cancelButtonTitle:@"取消" 5 destructiveButtonTitle:@"确定" 6 ... 阅读全文
posted @ 2013-08-01 18:13 wangzhenxiang 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 1 //获取系统时间 2 NSDate * date=[NSDate date]; 3 NSDateFormatter *dateformatter=[[NSDateFormatter alloc] init]; 4 [dateformatter setDateFormat:@"HH:mm"]; 5 NSString * locationString=[dateformatter stringFromDate:date]; 6 7 //[dateformatter setDateFormat:@"YYYY-MM-dd-HH-mm-ss"]; 8 //NS 阅读全文
posted @ 2013-08-01 14:12 wangzhenxiang 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 1 //从字符串分割到数组- componentsSeparatedByString:2 NSString *str = [NSString alloc] initWithString:@"a,b,c,d"];3 NSLog(@"str:%@",str); 4 NSArray *array = [str componentsSeparatedByString:@","];5 NSLog(@"array:%@",array);6 [str release]; 1 //从数组合并元素到字符串- componentsJo 阅读全文
posted @ 2013-07-30 10:09 wangzhenxiang 阅读(400) 评论(0) 推荐(0) 编辑
摘要: 1 1、创建常量字符串 2 NSString *str = @"Hello World!"; 3 4 2、创建空字符串,给予赋值 5 NSString *str = [[NSString alloc] init]; 6 str = @"Hello World!"; 7 [str release]; 8 9 10 3、initWithString方法 11 NSString *str = [[NSString alloc] initWithString:@"Hello World!"]; 12 [str release]; 13 14 阅读全文
posted @ 2013-07-29 18:36 wangzhenxiang 阅读(167) 评论(0) 推荐(0) 编辑
摘要: //判断是iphone或是ipad等1 NSLog(@"Device -- %@",[UIDevice currentDevice].model);//系统版本3 NSLog(@"version -- %@",[UIDevice currentDevice].systemVersion); 阅读全文
posted @ 2013-07-29 15:44 wangzhenxiang 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 首先导入CFNetwork.framework框架1、下载ASyncSocket库源码2、把ASyncSocket库源码加入项目3、在项目增加CFNetwork框架使用AsyncSocket开源的框架可以很方便的与其它系统进行Socket通信, AsyncSocket包括TCP和UDP,通过实现委托AsyncSocketDelegate进行交互。AsyncSocketDelegate有如下消息调用。 1 @implementation SocketComm 2 3 //初始话,创建socket 4 - (id) init 5 { 6 self = [super init]; 7 ... 阅读全文
posted @ 2013-07-29 14:55 wangzhenxiang 阅读(1363) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 13 下一页