摘要: 目前最新的Xcode版本,已经不能再用UIAlertView,已被UIAlertController取代,本文是自己学习UIAlertController的一个例子,只供参考!希望与各位共同进步。 #import <UIKit/UIKit.h> @interface ViewController : 阅读全文
posted @ 2016-03-10 19:02 唐唐_010 阅读(442) 评论(0) 推荐(0) 编辑
摘要: #import <UIKit/UIKit.h> @interface ViewController : UIViewController @property(strong,nonatomic) UISlider *MySlider; @property(strong,nonatomic) UIVie 阅读全文
posted @ 2016-03-09 22:51 唐唐_010 阅读(120) 评论(0) 推荐(0) 编辑
摘要: #import <UIKit/UIKit.h> @interface ViewController : UIViewController @property(strong,nonatomic) UIImageView *MyImage; @property(strong,nonatomic) UIT 阅读全文
posted @ 2016-03-09 22:47 唐唐_010 阅读(242) 评论(0) 推荐(0) 编辑
摘要: #import <Foundation/Foundation.h> @interface Computer : NSObject @property(assign,nonatomic) int ComCount; -(int)Punches;//出拳 @end #import "Computer.h 阅读全文
posted @ 2016-03-08 22:51 唐唐_010 阅读(266) 评论(0) 推荐(0) 编辑
摘要: #import <UIKit/UIKit.h> @interface ViewController : UIViewController @property(strong,nonatomic) UIButton *btnTest; @property(strong,nonatomic) UIText 阅读全文
posted @ 2016-03-08 22:42 唐唐_010 阅读(171) 评论(0) 推荐(0) 编辑
摘要: //1.初始化视图 self.myView=[[UIView alloc] initWithFrame:CGRectMake(100, 50, 200, 400)]; //2.myview的背景色 self.myView.backgroundColor=[UIColor redColor]; //3 阅读全文
posted @ 2016-03-07 21:53 唐唐_010 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 类方法:要点:1.只能用类来调用 ;2.类方法用加号表示;3.不会开辟空间创建对象;4.不能访问属性;5.一般用于定义工具方法 :根据传入的参数判断返回结果(不需要访问属性);字符串的查找;文件和数据库的操作特点:1.避免多次使用对象去调用方法,都要开辟储存空间;2.方法中没有使用到属性(成员变量) 阅读全文
posted @ 2016-03-06 22:15 唐唐_010 阅读(222) 评论(0) 推荐(0) 编辑
摘要: #import <Foundation/Foundation.h> @interface Student : NSObject -(void)Dothing; @end #import "Student.h" @interface Student () -(void)Sleep; @end #imp 阅读全文
posted @ 2016-03-05 08:26 唐唐_010 阅读(171) 评论(0) 推荐(0) 编辑
摘要: NSArray *arr=[NSArray arrayWithObjects:@"zs",@"ls",@"xm", nil]; //1.选择器排序法 NSArray *reorder=[arr sortedArrayUsingSelector:@selector(compare:)]; NSLog( 阅读全文
posted @ 2016-03-03 12:53 唐唐_010 阅读(142) 评论(0) 推荐(0) 编辑
摘要: //1.创建一个集合(初始化集合对象) NSArray *arr=[NSArray arrayWithObjects:@"zs",@"ls",@"ww", nil]; //2.集合元素个数 NSLog(@"%ld",arr.count); //3.获取指定索引位置的集合元素 NSString *na 阅读全文
posted @ 2016-03-03 12:51 唐唐_010 阅读(188) 评论(0) 推荐(0) 编辑