http://blog.csdn.net/totogo2010/article/details/7672271
新建一个Single View Application,并在加入viewDidLoad方法里加入如下代码:
- // 通过使用下面的方法得到程序的main bundle
- NSBundle *mainBundle = [NSBundle mainBundle];
- NSString *imagePath = [mainBundle pathForResource:@"QQ20120616-1" ofType:@"png"];
- NSLog(@"%@", imagePath);
- UIImage *image = [[UIImage alloc]initWithContentsOfFile:imagePath];
- UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
- [self.view addSubview:imageView];