【发布时间】:2010-04-06 17:58:10
【问题描述】:
UIImageView *one = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball1.png"]]] ;
UIImageView *two = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball2.png"]]] ;
UIImageView *three = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball3.png"]]] ;
arrayBalls = [[NSArray alloc]initWithObjects:one,two,three,nil];
我使用上面的代码在 UIPickerView 中显示图像。但是执行此代码时应用程序崩溃了。
请大家帮忙。
【问题讨论】:
标签: iphone objective-c cocoa-touch xcode