我有以下代码:
MapViewController.h
#import <UIKit/UIKit.h>
#import "PlaceViewController.h"
@interface MapViewController : UIViewController <MKMapViewDelegate> {
IBOutlet PlaceViewController *placeview;
}
- (IBAction)passPlace:(id)sender;
MapViewController.m
@synthesize placeview;
- (IBAction)passPlace:(id)sender{
self.placeview = [[[PlaceViewController alloc] initWithNibName:nil bundle:nil] autorelease];
[self presentViewController:placeview animated:YES completion:nil];
}
PlaceViewController.h
@interface PlaceViewController : UIViewController{
}
- (IBAction)back:(id)sender;
@end
PlaceViewController.m
@implementation PlaceViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
NSLog(@"Change!!!!!");
[super viewDidLoad];
// Do any additional setup after loading the view.
}
还有故事板:
http://img685.imageshack.us/img685/1233/screengy.png
我不知道我做错了什么,因为当我更改视图时, PlaceViewController 是一个带有蓝色状态栏的黑屏。
任何人都可以帮助我吗?谢谢