摘要: switch支持 byte short char int 和枚举类型 阅读全文
posted @ 2014-12-08 19:16 Rui.peng 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Objective-c主要分为四种基本数据类型:整型:short int (内存中占16位); 2个字节(Mac中)2个字节(ios) int(内存中占32位); 4 个字节(Mac中)4个字节(ios) long int(内存中占64位); 8个字节(Mac中) 4个... 阅读全文
posted @ 2014-12-08 19:15 Rui.peng 阅读(3753) 评论(0) 推荐(0) 编辑
摘要: 调试是我们必须掌握的一项技能,虽然之前也接触过调试,但是今天系统学习了一下调试的3种方法,在这里和大家分享一下:1.进入debug调试方式,右上角有对应变量的值;如果右上角没有可以 windows-->show view2.鼠标悬浮在一个变量上;3.选中一个变量,右击-->inspect(放大镜) ... 阅读全文
posted @ 2014-12-08 18:22 Rui.peng 阅读(637) 评论(0) 推荐(0) 编辑
摘要: viewDidUnload只有在收到内存警告后,controller连着的主View被释放了才会调用。而dealloc则是Controller释放的时候调用的,当然这个时候连着它的View也会被释放,但是这个时候是不会调用viewDidUnload的。init和viewDidLoad,当你创建一个C... 阅读全文
posted @ 2014-12-06 22:24 Rui.peng 阅读(185) 评论(0) 推荐(0) 编辑
摘要: NSUserDefaults适合存储轻量级的本地数据,比如要保存一个登陆界面的数据,用户名、密码之类的使用NSUserDefaults是首选。下次再登陆的时候就可以直接从NSUserDefaults里面读取上次登陆的信息。因为如果使用自己建立的plist文件什么的,还得自己显示创建文件,读取文件,很... 阅读全文
posted @ 2014-12-06 22:11 Rui.peng 阅读(277) 评论(0) 推荐(0) 编辑
摘要: Service概念及用途:A service is an application component that can perform long-running operations in the background and does not provide a user interface。通常... 阅读全文
posted @ 2014-12-04 17:30 Rui.peng 阅读(206) 评论(4) 推荐(0) 编辑
摘要: SharedPreference是Android提供的一种轻量级的数据存储方式,主要用来存储一些简单的配置信息,其以键值对的方式存储,使得我们能很方便进行读取和存入 SharedPreference 文件保存在/data/data//shared_prefs 路径下 通过Activity自... 阅读全文
posted @ 2014-12-04 17:07 Rui.peng 阅读(3951) 评论(0) 推荐(0) 编辑
摘要: Scrollview有几个主要的属性:contentSize:Scrollview中内容视图的大小,返回CGSize结构体类型,包含width和height2个成员;contentInset:用于在Scrollview中的内容视图周围添加边框,往往是为了留出空白以放置工具栏 标签栏 或导航栏cont... 阅读全文
posted @ 2014-12-02 22:29 Rui.peng 阅读(216) 评论(0) 推荐(0) 编辑
摘要: #import @interface ViewController : UITableViewController@property (weak, nonatomic) IBOutlet UILabel *Label1;- (IBAction)onClick:(id)sender;@end为了将事件... 阅读全文
posted @ 2014-12-02 19:46 Rui.peng 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 在我们创建一个新的.h 和 .m文件时,我们会看到.h:@implementation TestViewController- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loadin... 阅读全文
posted @ 2014-12-02 19:44 Rui.peng 阅读(455) 评论(0) 推荐(0) 编辑