ASIHttpRequest加载网络数据和上传数据功能
摘要:使用ASIHttpRequest第三库,需要配置二,上传数据功能使用ASIFromDataRequest(可以上传二进制和字符串给服务器)下面来牛刀小试//建立一个工程,导入第三方库,在AppDelegate.h#import #import "ASIFormDataRequest.h"@inter...
阅读全文
JSONModel
摘要:1 //仅仅声明属性的类,称为实体类(模型类)2 //Student.h中声明属性3 @property(strong,nonatomic)NSString *name;4 @property(assign,nonatomic)int age;5 @property(strong,nonatomic...
阅读全文
KVC/KVO
摘要:1 //KVC(Key Value Coding) 2 //KVC的作用给某个对象的属性赋值,和点语法中的赋值的作用相同 3 Student *stu=[[Student alloc]init]; 4 [stu setValue:@"xiaowang" forKey:@"name"]; 5 NSL...
阅读全文
jsonj解析网络数据
摘要://将网络数据加载到本地 NSString *strUrl=@"http://10.0.8.8/sns/my/user_list.php?page=1&number=5"; NSURL *url=[NSURL URLWithString:strUrl]; NSData *data=[[NSDa...
阅读全文
sandBoxPathFile
摘要://获得本应用程序的沙盒目录 NSArray *array=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *path=[array objectAtIndex:0...
阅读全文
手势与触控
摘要:UIImageView *imgView=[[UIImageView alloc]initWithFrame:CGRectMake(100, 100, 75, 75)]; imgView.image=[UIImage imageNamed:@"a"]; imgView.tag=200; [se...
阅读全文
图片分割
摘要:- (UIImage *)clipImage: (UIImage *)image inRect: (CGRect) rect{//返回image中rect范围内的图片 CGImageRef imageRef = CGImageCreateWithImageInRect(image.CGImage,...
阅读全文
UI常用控件
摘要://创建警告框对象UIAlertView *alertView=[[UIAlertView alloc]initWithTitle:@"警告!" message:@"您确定退出吗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"...
阅读全文
初学UIView
摘要://创建UIView对象//可以将其他空间添加到view上,当挪动View时,其他控件随之挪动UIView *view=[[UIView alloc]init];view.frame=CGRectMake(100,200,100,100);view.backgroundColor=[UIColor ...
阅读全文
停靠模式+GIF
摘要:UIView *redView=[[UIView alloc]initWithFrame:CGRectMake(0,20,200,200)];redView.backgroundColor=[UIColor redColor];//允许子视图放大或缩小 默认autoresizeSubviews的就为...
阅读全文
初学动画
摘要:NSMutableArray *mutArray=[[NSMutableArray alloc]init];for(int i=1;i<13;i++){//创建图片名称NSString *imgName=[[NSString alloc]initWithFormat:@"player%i.png",...
阅读全文
象棋
摘要:static 关键字,只初始化一次如果程序运行中没有改变它的值的话会一直根据程序变化 NSArray *array=@[@"车",@"马",@"象",@"王",@"后",@"象",@"马",@"车"]; for (int i=0; i<8; i++) { for (int j=0; j<8; j++
阅读全文
UIbutton
摘要://旋转180度button.transfrom=CGAffineTransformMakeRotation(M_PI);//将字符串按照+-*/进行分割NSArray *array=[self.showLabel.text componentSeparatedByCharactersInSet:[...
阅读全文