I have the following code in a UIViewController
Notepad *notepad = [[Notepad alloc] initForNewTopLevelTask:0 andDAO:self.dao];
[self.navigationController pushViewController:notepad animated:YES];
[notepad release];
The initForNewTopLevelTask:andDAO: method is:
- (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;
}
When I rotate the view nothing happens, it does not rotate. If I change the UIViewController line to:
Notepad *notepad = [[Notepad alloc] init];
It rotates fine!
The view is not part of a Tab Controller and I have implemented:
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return YES;
}