随笔分类 -  Objective-C

StoryBoard中使用xib
摘要:转自:http://blog.csdn.net/li6185377/article/details/8131042一般自定义View 代码方式 有 在初始化的时候添加 子Views[cpp]view plaincopy-(id)initWithFrame:(CGRect)frame{self=[superinitWithFrame:frame];... 阅读全文
posted @ 2014-09-15 11:44 М80メ 阅读(352) 评论(0) 推荐(0)
IOS下 UILabel 如何自动换行
摘要:转自:http://zasoft.blog.163.com/blog/static/205215176201301414915700/背景:相信很多朋友都遇到过,文本的内容长度不一,需要根据内容的多少来自动换行处理。场景:很多APP中评论,有的评论长,有的评论短,有的一行,有的多行。下面以评论的实现为例来说说具体如何实现。技术点:UILabel的自动换行,自动换行的同时要自适应Frame大小。... 阅读全文
posted @ 2014-08-18 20:29 М80メ 阅读(305) 评论(0) 推荐(0)
Mac 10.9 安装及使用 phoneGap
摘要:公司网速是个坑啊 绝对掉进去就起不来的那种.....按官网的说法:1. 下载并安装Node.js2.sudo npm install -g phonegap官网的安装步骤到此为止....坑啊 按官网的Usage,死活搞不出iOS端....于是:1. sudo npm install -g ios-sim2.正常新建项目 phonegap creat myApp com.xxxx.m... 阅读全文
posted @ 2014-07-23 22:11 М80メ 阅读(144) 评论(0) 推荐(0)
AFNetworking实时监测网络连接
摘要:// 网络变化消息 [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(checkNetwork) name: kReachabilityChangedNotification object: nil]; Reachability *reach = [Reachability... 阅读全文
posted @ 2014-07-14 12:44 М80メ 阅读(276) 评论(0) 推荐(0)
[UIScreen mainScreen].applicationFrame与[UIScreen mainScreen].bounds区别
摘要:[UIScreen mainScreen].applicationFrame与[UIScreen mainScreen].bounds区别:applicationFrame会自动判断是否存在状态栏,其值为{0,0},{320,480}或{0,20},{320,480}bounds不会自动判断,值永远为{0,0},{320,480} 阅读全文
posted @ 2014-06-11 12:01 М80メ 阅读(199) 评论(0) 推荐(0)
检测应用版本
摘要:#pragma mark - 版本检测- (void) checkVersion{ // 版本号的key NSString *key = (NSString *)kCFBundleVersionKey; // 从info.plist取版本号 NSString *version = [NSBundle mainBundle].infoDictionary[key... 阅读全文
posted @ 2014-06-11 11:10 М80メ 阅读(148) 评论(0) 推荐(0)
iOS7中Cell高度 Label高度自适应
摘要:- (float)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ NSString *str = [_dataArray objectAtIndex:indexPath.row]; UIFont *tfont = [UIFont systemFontOfSize:... 阅读全文
posted @ 2014-06-11 09:54 М80メ 阅读(253) 评论(0) 推荐(0)
使用Reachability检测网格
摘要:#pragma mark - 网络连接检查- (void) currentReach{ // 网络检测 Reachability *curReach = [Reachability reachabilityForInternetConnection]; switch ([curReach currentReachabilityStatus]) { cas... 阅读全文
posted @ 2014-06-10 14:58 М80メ 阅读(167) 评论(0) 推荐(0)
Object-C 基本数据类型
摘要:int型: 如果整型值的第一位是0,则该数为8进制。050即是8进制的50(10进制40); 如果整型值以0x开头,则该数为16进制。 16进制数在输出显示时,用%0x表示,但使用后不带数值的前缀0x,如需表示16进制数的前缀,则需使用%#x。float类型: 要显示浮点数的值,可用NSLog转换字符%f; 要使用科学计数法显示值,应使用NSLog格式字符%e。 ... 阅读全文
posted @ 2013-08-11 17:06 М80メ 阅读(481) 评论(0) 推荐(0)
从类开始
摘要:打开程序 什么@interface @implementation 让我直晕……..还好例程很简单,读了一下后就明白了.还是简单的记录一下吧.@interface部分只是告诉程序该类来自何处,还有定义一下处理该类对象时将要用到的各种属性 方法. 一般来说: @interface 类名 : 父类 神... 阅读全文
posted @ 2013-08-11 15:53 М80メ 阅读(137) 评论(0) 推荐(0)
开始学习Objective-C
摘要:加油! 顺便试试这MarsEdit好用不~ 阅读全文
posted @ 2013-08-11 15:22 М80メ 阅读(112) 评论(0) 推荐(0)