Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3216458
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:17:49+00:00 2026-05-17T15:17:49+00:00

i have created a project which has different xib viewcontrollers.In first view am selecting

  • 0

i have created a project which has different xib viewcontrollers.In first view am selecting an image through picker controller and am displaying it in the secondviewcontroller.In secondview controller i have some buttons and i have given some IBActions to them.Here starts my problem that am successfully displaying the image in secondviewcontorller but when i tap on button in that viewcontroller app is terminating and the debugger showing the error message as program terminated due to uncaught exception

Here is the code:

To select the pic through pickercontroller in first view

-(IBAction)btnChoosePicClicked {
    if([UIImagePickerController         isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary])
    {
        UIImagePickerController *picker=[[UIImagePickerController alloc] init];
        picker.delegate=self;
        picker.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;  
        [self presentModalViewController:picker animated:YES];
        [picker release];

    }
    else 
    {
        UIAlertView *alert =[[UIAlertView alloc]initWithTitle:@"Error accessing photo library"   message:@"Device does not support a photo library" delegate:nil cancelButtonTitle:@"Drat!"                   otherButtonTitles:nil];

        [alert show];
        [alert release];
    }

}

displaying in the second view and assigning the actions .h file

@interface editScreen : UIViewController{
    IBOutlet UIButton *btnRotate;
    IBOutlet UIButton *btnLibrary;
    IBOutlet UIImageView *imgView;
    int RotateAngle;
}
-(void)setImage:(UIImage *)img;
-(IBAction)btnLibraryClicked;
-(IBAction)RotateImage;
@end

.m file

@implementation editScreen
-(void)setImage:(UIImage *)img
{
    [imgView setImage:img];
    imgView.userInteractionEnabled = YES;
}
-(IBAction)RotateImage
{
    CGAffineTransform transform = imgView.transform;
    transform = CGAffineTransformRotate(transform, M_PI/2);
    imgView.transform=transform;

    RotateAngle+=90;

    if(RotateAngle>=360)
    {
        RotateAngle-=360;
    }
    //imageview.transform = CGAffineTransformScale(imageview.transform, -1.0, 1.0);
}
-(IBAction)btnLibraryClicked {


    if([UIImagePickerController                   isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary])
    {
        UIImagePickerController *picker=[[UIImagePickerController alloc] init];
        picker.delegate=self;
        picker.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;  
        [self presentModalViewController:picker animated:YES];
        [picker release];
        // NSFileHandle *fileHandle = [[NSFileHandle alloc]initWithFileDescript
    }
    else 
    {
        UIAlertView *alert =[[UIAlertView alloc]initWithTitle:@"Error accessing photo library" message:@"Device does not support a photo library" delegate:nil cancelButtonTitle:@"Drat!" otherButtonTitles:nil];

        [alert show];
        [alert release];
    }

}

I dont know whats wrong with my code please help me.I have given appropriate connections in IB..
Thanks in Advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:17:49+00:00Added an answer on May 17, 2026 at 3:17 pm

    For some UIKit class, his delegate has some methods which must be implemented.
    For example, UIImagePickerViewControllerDelegate must implement following methods:

    • – imagePickerController:didFinishPickingMediaWithInfo:
    • – imagePickerControllerDidCancel:

    For your above codes, I don’t know whether these methods are implemented or not. Hope these information can help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a a subclass of Table in my ASP.NET project which creates.
I have created a small flash CS4 project that has a few custom components
I have a big project that was first created in Borland C++ 6. We're
I have created a WiX project that installs a bunch of different EXEs and
I have a project in which i created a class called validator. i also
I have a feature which allows the user to create projects and view it
I have created a setup project using Visual Studio 2008. After the application is
I have created a setup project in VS2008. My WinForms app uses .NET 2.0,
I have created a custom dialog for Visual Studio Setup Project using the steps
In order to improve my open source project, I need testers. I have created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.