Soru & Cevap

pushviewcontroller ...

23.06.2014 - 06:26

merhaba,

Uygulamanin root sayfasi bir viewcontroller gecis yapmak istedigim sayfa tableviewcontroller sayfasi ama gecis yapamiyor.TableViewController sinifimi yaparken subclass UITableViewController olarak yaptim. Bunun icin cozum onerisi olan varsa cok sevinirim.

Tesekkurler.

21 Görüntülenme

2 Cevap

Sitedeki sorulara cevap verebilmek için giriş yapın ya da üye olun.

picture-3650-1421928561.jpg
anilsozeri
24.06.2014 - 05:15

Navigation Controller ve Push Segue kullanarak ise kodda herhangi bir değişiklik olmuyor sadece Storyboardüzerinden eklemeler yapılıyor, eklediğim resimlerde mevcut.

/sites/default/files/cevaplar/dosya/2020/file-storyboard.png /sites/default/files/cevaplar/dosya/2020/file-rootview.png /sites/default/files/cevaplar/dosya/2020/file-pushsegue.png /sites/default/files/cevaplar/dosya/2020/file-simulator_0.png /sites/default/files/cevaplar/dosya/2020/file-simulatornavigationbutton.png
server calap
30.06.2014 - 03:35
cok tesekkur ederim anil...
picture-3650-1421928561.jpg
anilsozeri
24.06.2014 - 04:59

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