Merhaba,
Storyboard üzerinden elimden geldiğince basit bir örnek yaparak anlatmaya çalıştım umarım yardımcı olabilirim.
TableViewController.m
[code]
//
// TableViewController.m
// TableViewExample
//
// Created by Anıl SÖZERİ on 24/06/14.
// Copyright (c) 2014 aS. All rights reserved.
//
#import "TableViewController.h"
@interface TableViewController (){
NSArray *array;
}
@end
@implementation TableViewController
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
array = [NSArray arrayWithObjects:@"1",@"2",@"3", nil];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
#warning Potentially incomplete method implementation.
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
#warning Incomplete method implementation.
// Return the number of rows in the section.
return [array count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"MyCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
cell.textLabel.text = [array objectAtIndex:indexPath.row];
return cell;
}
@end
[/code]
İyi çalışmalar.
/sites/default/files/cevaplar/dosya/2020/file-modalsegue.png
/sites/default/files/cevaplar/dosya/2020/file-cellidentifier.png
/sites/default/files/cevaplar/dosya/2020/file-simulator.png
/sites/default/files/cevaplar/dosya/2020/file-simulatorbuttontap.png
/sites/default/files/cevaplar/dosya/2020/file-simulatorlastview.png