我有最新版本的Xcode.在我的一个项目中,我注意到iPhone的视图是新的iPhone 5屏幕尺寸.我喜欢它,但有没有办法切换回较小的屏幕尺寸?不是每个人都拥有iPhone 5.
我在View Controller中有一个表视图.我可以在表视图中填充所有信息.但是我在设置详细视图时有点迷失.我相信每个表格单元格需要一个segue到每个细节视图但不完全确定.
这是我的代码.从表格视图到详细视图完成segue我缺少什么?码:
.h
@interface DetailViewController : UIViewController <UITableViewDelegate,UITableViewDataSource>
{
IBOutlet UITableView *myTable;
NSMutableArray *contentArray;
}
@property (strong, nonatomic) IBOutlet UITableView *myTable;
.m
- (void)viewDidLoad
{
contentArray = [[NSMutableArray alloc]init];
[contentArray addObject:@"Espresso"];
[contentArray addObject:@"Latte"];
[contentArray addObject:@"Capicino"];
[super viewDidLoad];
// Do any additional setup after loading the view.
}
//Table Information
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [contentArray count];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if([[contentArray objectAtIndex:indexPath.row]isEqualToString:@"EspressoViewController"])
{
EspressoViewController *espresso = …Run Code Online (Sandbox Code Playgroud) objective-c uitableview uiviewcontroller ios uistoryboardsegue