您的位置:首页 > 移动开发 > IOS开发

ios 笔记

2014-02-28 11:42 218 查看
—nil 和NULL 是一样的,我们使用nil 而不用NULL 是因为我们用来表示对象的指针为空。

—#import 和#include 是一样的,但是#import 可以确保引用的文件只被引用一次。

— 谁retain,谁release

将已知地址的图片显示到 View 上

NSURL *url=[NSURL URLWithString:@"http://demo.gnway.com:8000/Icons/5.ico"];

NSData *data=[NSData dataWithContentsOfURL:url];

UIImage *tmpimage=[[UIImage alloc] initWithData:data];

UIImageView *imageview =[[UIImageView alloc] initWithFrame:CGRectMake(100,

100, 100, 100)];

imageview.image=tmpimage;

[self.view addSubview:imageview];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: