views:

44

answers:

1

Hello, I have a UIViewController that inherits all the delegation for the UITable. I have a UITableView called table that is set in my simple_tableViewController.h.

I have set

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES; }

but the main view rotates but the table does not.

I have been searching for over a few hours now to find out how to implement the rotation from portrait to landscape for my UITableView inside my UIViewController.

Here is some code


@interface simple_tableViewController : UIViewController 
 
{
 UITableView *table;
 UISearchBar *search;
 NSDictionary *allNames;
 NSMutableDictionary *allNamesSearch;
 NSMutableDictionary *names;
 NSMutableArray *keys;
 BOOL isSearching;
}
@property (nonatomic, retain) IBOutlet UITableView *table;
@property (nonatomic, retain) IBOutlet UISearchBar *search;
@property (nonatomic, retain) NSDictionary *allNames;
@property (nonatomic, retain) NSMutableDictionary *allNamesSearch;
@property (nonatomic, retain) NSMutableDictionary *names;
@property (nonatomic, retain) NSMutableArray *keys;
@property (nonatomic, retain) NSMutableArray *keysSearch;
- (void)resetSearch;
- (void)handleSearchForTerm:(NSString *)searchTerm;

@end

You can see where I create the UITableView.

Thanks

A: 

Ok so it was because I was adding the view to the main window view. So the main window view was rotating but the navigation controller view was not.

Hope that helps someone out.

Thanks

Wes Duff

related questions