views:

93

answers:

1

I working in iPhone application, i am picking an image from photo library using UIImage picker control, then processing it and displays the image and the corresponding output using UIImageview and UITextview respectively. For some images it working fine and for some of images program crashed and while checking this with break point i am getting message like PROGRAM RECEIVED SIGNAL SIGABRT. can any one suggest me how to handle this error. Note: For every image i am getting output, i checked it with breakpoint. my sample code is here,

To display image:

    CGRect myImageRect = CGRectMake(0.0f, 0.0f, 320.0f, 240.0f);

UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect]; [myImage setImage:img]; myImage.opaque = YES; // explicitly opaque for performance [self.view addSubview:myImage]; [myImage release];

To display text:

    CGRect frame = CGRectMake(0.0f, 250.0f, 320.0f,25.0f);

UITextView * tmpTextView = [[UITextView alloc]initWithFrame:frame]; tmpTextView.text = [NSString stringWithFormat:@"%@%@",@"value: ", somevalue]; [self.view addSubview:tmpTextView]; [tmpTextView release];

A: 

SIGABRT is raised by the abort() function. abort() is called by the standard assert() macro when an assertion fails. It's impossible to tell exactly what's going on in your program without more information, but my best guess is that you have a failed assertion somewhere in your code, in which case the output would also tell you the filename and line number of the failed assertion.

Adam Rosenfield