我有這段代碼試圖在一個循環中運行一組簡單的圖像。所有我在應用程序中一個的UIImageView在我的視圖控制器的.h文件中聲明:[UIImageView _isResizable]:無法識別的選擇器發送到實例SIGABRT
@property (strong, nonatomic) IBOutlet UIImageView *imageDisplay;
在我的.m文件的viewDidLoad方法如下:
NSMutableArray *imageView = [[NSMutableArray alloc] init];
[imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim1.png"]]];
[imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim2.png"]]];
[imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim3.png"]]];
[imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim4.png"]]];
[imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim5.png"]]];
[imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim6.png"]]];
[imageView addObject:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"EyeAnim7.png"]]];
imageDisplay.animationImages = imageView;
imageDisplay.animationDuration = 0.25;
imageDisplay.animationRepeatCount = 50;
[imageDisplay startAnimating];
的代碼似乎拍擊「imageDisplay.animationImages」這一行,就好像我創建了UIImageView,創建它的getter和setter,然後構建,直到我取消註釋該行爲止。如果我取消註釋,它會一直給我提供錯誤,直到我刪除UIImageView並創建一個新的UIImageView。
不太確定發生了什麼,任何幫助表示讚賞!
當你說它崩潰時,它崩潰的具體錯誤是什麼? – Will 2012-03-07 23:11:19