您能否告诉我实施模态视图的最佳方法,以便每次选择/推送某个标签时它都会出现?因为我当前拥有代码的方式会导致所有后续选择/推送无效。
#import <UIKit/UIKit.h>
@interface SecondViewController : UIViewController <UIImagePickerControllerDelegate, UINavigationControllerDelegate>
{
UIImage *image;
IBOutlet UIImageView *imageView;
}
@end
#import "SecondViewController.h"
@implementation SecondViewController
- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
image = [info objectForKey:UIImagePickerControllerOriginalImage];
imageView.image = image;
[self dismissModalViewControllerAnimated:YES];
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
[super viewDidLoad];
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
[self presentModalViewController:picker animated:YES];
[picker release];
}
...
@end
答案 0 :(得分:2)
你可以看看
-(void)viewWillAppear {}