无法在iPhone的下一个视图中显示图像

时间:2013-03-04 14:58:00

标签: iphone ios

我是iPhone编程的新手。我在缩略图中显示图像。用户可以选择多个缩略图,并将它们存储在一个数组中。在选择缩略图后单击完成按钮时,图像将显示在下一个视图中。

如果在第二个屏幕上单击完成按钮,则应用程序崩溃。选定的图像存储在数组中,记录数组显示存储的图像。应用程序崩溃而不显示存储的图像。

 2013-03-04 20:21:53.826 ImageStuf[929:11303] (
        "<UIImageView: 0x71741b0; frame = (80 10; 60 50); opaque = NO; tag = 1; gestureRecognizers = <NSArray: 0x71749b0>; layer = <CALayer: 0x7174d40>>",
        "<UIImageView: 0x71749e0; frame = (150 10; 60 50); opaque = NO; tag = 1; gestureRecognizers = <NSArray: 0x7175950>; layer = <CALayer: 0x7175d20>>",
        "<UIImageView: 0x7171290; frame = (10 10; 60 50); opaque = NO; tag = 1; gestureRecognizers = <NSArray: 0x7174170>; layer = <CALayer: 0x7172b30>>"
    )
    2013-03-04 20:21:53.828 ImageStuf[929:11303] -[UIImageView length]: unrecognized selector sent to instance 0x71741b0
    2013-03-04 20:21:53.830 ImageStuf[929:11303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView length]: unrecognized selector sent to instance 0x71741b0'
    *** First throw call stack:
    (0x159e012 0x12abe7e 0x16294bd 0x158dbbc 0x158d94e 0x3551c4 0x21180a 0x53ba 0x2d11c7 0x2d1232 0x2d14da 0x2e88e5 0x2e89cb 0x2e8c76 0x2e8d71 0x2e989b 0x2e9e93 0x2e9a88 0x4bb8 0x12bf705 0x1f32c0 0x1f3258 0x2b4021 0x2b457f 0x2b36e8 0x222cef 0x222f02 0x200d4a 0x1f2698 0x2600df9 0x2600ad0 0x1513bf5 0x1513962 0x1544bb6 0x1543f44 0x1543e1b 0x25ff7e3 0x25ff668 0x1efffc 0x2b72 0x2aa5 0x1)
    libc++abi.dylib: terminate called throwing an exception
    (lldb) 

编码部分低于一个

- (void)viewDidLoad
{
    NSLog(@"%@",mSelectedImagePassing);
    theSlideShowVew=[[UIImageView alloc]initWithFrame:self.view.bounds];
    theSlideShowVew.backgroundColor=[UIColor blackColor];
    [self.view addSubview:theSlideShowVew];
    theSlideShowVew.image=[UIImage imageNamed:mSelectedImagePassing[0]];

    [NSTimer scheduledTimerWithTimeInterval: 3.0
                                     target: self
                                   selector:@selector(handleTimer)
                                   userInfo: nil
                                    repeats: YES];

    [super viewDidLoad];
}
-(void)handleTimer
{
    countImage++;
    if ( countImage >= mSelectedImagePassing.count )
        countImage = 0;
    theSlideShowVew.image=[UIImage imageNamed:mSelectedImagePassing[countImage]];  


}

任何机构都可以告诉我这段代码中的错误是什么。 谢谢 阿斯拉姆

0 个答案:

没有答案