Skocz do zawartości

Witaj!

Zaloguj lub Zarejestruj się aby uzyskać pełny dostęp do forum.

Zdjęcie
- - - - -

Przesyłanie informacji pomiędzy widokami w TabBarApplication


  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Wojtekf6

Wojtekf6
  • 31 postów

Napisano 11 czerwca 2015 - 17:13

Witam,
Mam problem z przesłaniem informacji z jednego widoku do drugiego w TabBar, przy czym drugi widok to TableViewController.

 

Robię to tak:

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

{

    tableView *tableViewController = [segue destinationViewController];

    tableViewController.label = @"abc";

}

 

Następnie w "tableViewController":

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    

    static NSString* CellIdentifier = @"cell";

    TableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

    

    cell.napisLabel.text = self.label;

    

    return cell;

}

 

Oczywiście w w tableViewController mam zaimportowane "tableViewCell" oraz "viewController"(z którego przesyłam dane).

Dopiero się uczę, a TabBar używam pierwszy raz. Czy tutaj też używa się metody "prepareForSegue"?
 

 






Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych