Uialertview xcode alertView教程在模拟器上返回空白
刚接触xcode和obj-c,我花了两天时间试图解决这个问题 这是我的alertViewController.hUialertview xcode alertView教程在模拟器上返回空白,uialertview,Uialertview,刚接触xcode和obj-c,我花了两天时间试图解决这个问题 这是我的alertViewController.h #import <UIKit/UIKit.h> @interface alert_ViewController : UIViewController <UIAlertViewDelegate> @end 我在模拟器上运行这个项目,结果是空白的。有什么想法吗? 谢谢你能发布到教程的链接吗?教程是针对xcode 4的,这只是其中的一个小插曲。我的问题是为什么vi
#import <UIKit/UIKit.h>
@interface alert_ViewController : UIViewController <UIAlertViewDelegate>
@end
我在模拟器上运行这个项目,结果是空白的。有什么想法吗?
谢谢你能发布到教程的链接吗?教程是针对xcode 4的,这只是其中的一个小插曲。我的问题是为什么viewDidAppear从未被调用?我的代码放错地方了吗?真奇怪。需要查看代码的其余部分才能对此进行注释。的可能重复项
#import "ViewController.h"
@implementation alert_ViewController
- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
self.view.backgroundColor = [UIColor whiteColor];
NSString *message = @"Are you sure?";
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle: @"Proceed?"
message:message
delegate:self
cancelButtonTitle: @"No"
otherButtonTitles: @"Yes", nil];
[alertView show];
}
@end