- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
UITableViewCell *cell = (UITableViewCell*)sender;
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
Favorite *favorite = [self.favoriteItems objectAtIndex:indexPath.row];
stopString = favorite.title;
routeString = favorite.subtitle;
UIViewController *destination = segue.destinationViewController;
if ([destination respondsToSelector:@selector(setDelegate:)])
{
[destination setValue:self forKey:@"delegate"];
}
if ([destination respondsToSelector:@selector(setSelection:)])
{
NSString *route = routeString;
NSDictionary *selection1 = [NSDictionary dictionaryWithObjectsAndKeys:route, @"route", stopString, @"stop", nil];
[destination setValue:selection1 forKey:@"selection"];
}
}
IOS storyboard UITableViewCell 单击传值
最新推荐文章于 2025-12-04 14:59:40 发布
本文深入探讨了使用Swift语言开发iOS应用的关键技巧,包括高效编程实践、性能优化策略、错误处理方法及代码复用原则,旨在帮助开发者提高开发效率并创建高质量的应用。
7560

被折叠的 条评论
为什么被折叠?



