1
我遇到的问题是我有我的起始页,然后用户可以从那里选择一个按钮来打开设置页面(模态视图)。在设置页面中,用户选择开关打开PIN码页面(另一个模态视图)。我一直在试图实施这个简单的过程而自杀。该应用程序有一个Nav &标签栏框架。我似乎无法得到这个权利。即时通讯使用的代码如下:多模态视图故障
#import "SwitchResponderViewController.h"
@implementation SwitchResponderViewController
- (void)viewDidLoad {
[super viewDidLoad];
[sw addTarget:self action:@selector(switched) forControlEvents:UIControlEventValueChanged];
}
- (void)dealloc {
[secondController release], secondController = nil;
[super dealloc];
}
- (void)switched;
{
if ([sw isOn])
{
NSLog(@"On");
if (!secondController)
secondController = [[SecondViewController alloc] init];
[self presentModalViewController:secondController animated:YES];
}
else
{
NSLog(@"Off");
}
}
@end
我然后创建一个IBOutlet UISwitch在我的视图控制器叫SW和IB把它挂。但我不能让它编译和工作。有任何想法吗?
之后得到了一个额外的分号,您是正确的。有什么建议么? – SympleMyne 2009-10-04 20:14:07
周一早上的工作人员对此有所帮助。 – SympleMyne 2009-10-05 15:55:11
我的建议是用一个按钮替换开关,并摆脱分号 – 2009-10-06 04:02:48