У меня еще один вопрос. Я делал приложение книга рецептов и использовал в нем search bar, но когда я переходил к результату поиска через search bar, то внутри получилась "каша". Можете подсказать в чем проблема и как исправить. Спасибо.
Иван Воробей, Если я передаю 3 массива, то с каждого массива берется по одному значению и передается первое значение с каждого массива. Но все значение из массива не передаются.
Это моя первая таблица(главная):
- (void)viewDidLoad {
devices = @[@"iPhone", @"iPad", @"iMac"];
[super viewDidLoad];
// 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;
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
return 3;
}
// 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;
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
return 3;
}
Название ячейки первой таблицы: "One", Two", "Three". А когда мы переходим в первую ячейку "One" название ячеек должно быть 1,2,3. А когда мы переходим в ячейку "Two" название ячеек должно быть 4,5,6. То есть просто должны быть разные название. Но если я задаю cell.textLabel.text = @[@"1", @"2", @"3"], то эти название передаются всем 9 ячейкам, а должно, только первым 3. Спасибо.
Написано
Войдите на сайт
Чтобы задать вопрос и получить на него квалифицированный ответ.