views:

37

answers:

1

What I'm trying to do is, I have a button that opens up the photo library so the user can choose the photo and then the photo is then displayed on another view (another .xib file). How can I do this? Right now, I have both the photo library action and change view action pointing towards the button and its crashing due to both actions happening at once. Is there a pause or anything that I can add?

A: 

You should let one IBAction control your behavior, maybe this will help you:

    - (IBAction)myButtonAction:(id)sender {
        if ([fooController respondsToSelector:@selector(showLibrary)]) {
            [fooController performSelector:@selector(showLibrary)];
        }
        if ([barController respondsToSelector:@selector(displayImage:)]) {
            [barController performSelector:@selector(displayImage:) withObject:image afterDelay:0.1];
       }
    }
Brandon