aeciftci
aeciftci

Reputation: 679

UIPickerView Causes Application To Crash

I have two views. First : FirstViewController Second: SecondViewController

FirstView Controller is my UINavigationController's root controller and I have a table in it. When a cell is clicked view is navigated to SecondViewController. In SecondViewController I am trying to put a UIPickerView.

In SecondViewController.h, I have:

@interface SearchOptionController : UIViewController {

    IBOutlet UIPickerView *pickerView;
    NSMutableArray *optionArray;

}


@property (nonatomic, retain) IBOutlet UIPickerView *pickerView;
@property (nonatomic, retain) NSMutableArray *optionArray;

@end 

In SecondViewController.m i have:

@synthesize pickerView;

and all pickerview methods.

I added UIPickerView from the interface builder and selected File's Owner for Delegate and Data Source. But when the ViewDidLoad method ends in SecondViewController the application crashes saying:

Program received signal: SIGABRT

at second line of:

int main(int argc, char *argv[])
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, nil);
    [pool release];
    return retVal;
}

What am i supposed to do to prevent this crash and let the view load with uipickerview?

Edit:

When I remove the UIPickerView from Interface Builder, application runs correctly. I guess I have some problem with putting UIPickerView inside UIView, but i could not handle, being newbie is hard .s

Upvotes: 2

Views: 981

Answers (1)

Jeremy Bassett
Jeremy Bassett

Reputation: 171

You need to make sure that you have implemented the delegate methods for this object.

Upvotes: 2

Related Questions