上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: UILabel基础知识:UILabel *label1=[[UILabel alloc]initWithFrame:CGRectMake(100, 100, 120, 120)];//创建并设置Frame label1.numberOfLines=3;//设置文本最多行数,为0时没有最大行数限制 ... 阅读全文
posted @ 2015-11-15 15:27 开心刘哈哈 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 第一、UIButton的定义 UIButton *button=[[UIButton buttonWithType:(UIButtonType); 能够定义的button类型有以下6种, typedef enum { UIButtonTypeCustom = 0, 自定义风格 UIBut... 阅读全文
posted @ 2015-11-15 14:37 开心刘哈哈 阅读(243) 评论(0) 推荐(0) 编辑
摘要: NSNumber转NSString:假设现有一NSNumber的变量A,要转换成NSString类型的B方法如下:NSNumberFormatter* numberFormatter = [[NSNumberFormatteralloc]init];B= [numberFormatterstring... 阅读全文
posted @ 2015-11-13 20:49 开心刘哈哈 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 一、基本属性 1、创建文本输入框 UITextField*textField=[[UITextFieldalloc]initWithFrame:CGRectMake(10,10,200,20)]; 2、设置边框样式 textField.borderStyle=UITextBorderStyl... 阅读全文
posted @ 2015-11-13 15:07 开心刘哈哈 阅读(158) 评论(0) 推荐(0) 编辑
摘要: #import "Person.h"#import "Book.h"#import "Student.h"#import "Dog.h"#import int main(int argc, const char * argv[]) { @autoreleasepool { //*... 阅读全文
posted @ 2015-11-10 19:33 开心刘哈哈 阅读(137) 评论(0) 推荐(0) 编辑
摘要: //结构://main.m 1 #import 2 #import "Rent1.h" 3 #import "Rent2.h" 4 #import "Rent3.h" 5 #import "Person.h" 6 7 int main(int argc, const char * argv[])... 阅读全文
posted @ 2015-11-10 19:19 开心刘哈哈 阅读(148) 评论(0) 推荐(0) 编辑
摘要: //ProtocolClass.h#import //声明一个协议:@protocol+协议名+满足的基协议@protocol MyselfDelegate @required//修饰的方法为必须实现的方法-(void)helloProtocolForR;@optional//修饰的方法为可选实现的... 阅读全文
posted @ 2015-11-10 19:03 开心刘哈哈 阅读(182) 评论(0) 推荐(0) 编辑
摘要: //Study.m文件声明1 #import 2 3 @interface Study : NSObject4 5 -(void)study; 6 7 @end//Study.h文件实现 1 #import "Study.h" 2 3 @interface Study ()//偷偷声明 4 5 ... 阅读全文
posted @ 2015-11-10 18:51 开心刘哈哈 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 1.单例:nsfilemanager2.私有属性: @private3.内存:内存管理 1>.alloc,retain,copy,new2>.黄金法则4.继承和类目的拓展区别5.NSNotification(通知)和KVO(键-值监听)的区别6.延展: //延展性,实现方法私有化@in... 阅读全文
posted @ 2015-11-10 18:36 开心刘哈哈 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 一、点语法1> 基本使用点语法本质上是set方法/get方法的调用2> 使用注意若出现在赋值操作符的右边,在执行时会转换成get方法若出现在赋值操作符的左边,在执行时会转换成set方法不能在set、get方法中用self使用点语法,会造成死循环二、property和synthesize关键字1> @... 阅读全文
posted @ 2015-11-09 21:36 开心刘哈哈 阅读(149) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 下一页