我在uiviewcontroller中有以下代码
Notepad *notepad = [[Notepad alloc] initForNewTopLevelTask:0 andDAO:self.dao];
[self.navigationController pushViewController:notepad animated:YES];
[notepad release];
initfornewtopleveltask:和dao:方法是:
- (id) initForNewTopLevelTask:(int) theTableSize andDAO:(DAO*) aDAO {
self.dao = aDAO;
tableSize = [[NSNumber alloc] initWithInt:theTableSize];
self.isNew = [NSNumber numberWithBool:YES];
self.isSubtask =[NSNumber numberWithBool:NO];
return self;
}
当我旋转视图时,没有发生任何事情,它不会旋转。如果我将uiviewcontroller行更改为:
Notepad *notepad = [[Notepad alloc] init];
它旋转得很好!
该视图不是选项卡控制器的一部分,我已经实现了:
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return YES;
}