- (void)viewDidLoad
{
[super viewDidLoad];
for (int j = 0; j < 1; j ++) {
for (int i = 2; i <= 122; i ++) {
//named
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%d.png",i]];
//bundle
UIImage *image = [UIImage imageWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[NSString stringWithFormat:@"%d.png",i]]];
//data
NSString *filePath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%d",i] ofType:@"png"];
NSData *imageData = [NSData dataWithContentsOfFile:filePath];
UIImage *image = [UIImage imageWithData:imageData];
if (image)
{
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
imageView.frame = CGRectMake(0, 10*i, 50, 50);
[self.view addSubview:imageView];
[imageView release];
}
}
}
}