我有一个Pi,与一个UITextInput场和一个纽芬兰州开立了问答书。 当纽芬兰人要求使用代表方法时,应当对投入进行验证,并成功执行,或再次就失败发表《国际律师组织书》。
Now I reduced it to this litte test class with two UIAlertViews. It is always possible to open the other view but when I hit the button it asks for the screen remains empty.
#import "Yesorno.h"
@implementation Yesorno
@synthesize promptYES, promptNO;
- (id)init {
self = [super init];
if (self) {
promptYES = [[UIAlertView alloc] init];
[promptYES setDelegate:self];
[promptYES setTitle:@"Press YES"];
[promptYES addButtonWithTitle:@"YES"];
[promptYES addButtonWithTitle:@"NO"];
promptNO = [[UIAlertView alloc] init];
[promptNO setDelegate:self];
[promptNO setTitle:@"Press NO!"];
[promptNO addButtonWithTitle:@"YES"];
[promptNO addButtonWithTitle:@"NO"];
}
return self;
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0)
[promptYES show];
else
[promptNO show];
}
@end
Edit: The AppDelegate. 现在确实是一个非常基本的申请,没有任何观点的控制者。
#import "AppDelegate.h"
#import "Yesorno.h"
@implementation AppDelegate
@synthesize window, yesorno;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window makeKeyAndVisible];
yesorno = [[Yesorno alloc] init];
[yesorno.promptYES show];
return YES;
}
@end
我如何再次表明同样的辩词? 感谢。