- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的应用程序中的
UITableView
是使用 NSFetchedResultsController
进行管理的,我想实现主从行为,但每次我点击单元格时都会收到此 -[UIViewController setActivity:]: 无法识别的选择器发送到实例 0x176a7660
错误...
我不知道发生了什么,因为我的代码基于 Apple 的 Master-Detail 演示应用程序。这是prepareForSegue
:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"activitySegue"]) {
ActivityDetailsViewController *advc = segue.destinationViewController;
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
Activity *activity = (Activity *)[[self fetchedResultsController] objectAtIndexPath:indexPath];
[advc setActivity:activity];
}
}
当然,在destinationViewController中声明了@property
。我认为这个 NSManagedObject
可能有问题,并且它没有正确传递到目的地......但这只是我的猜测。
最佳答案
看起来您的 Storyboard 中的 View Controller 类的名称没有设置为详细 View Controller ,因此 UIViewController
的实例被创建而不是 ActivityDetailsViewController
的实例.
将 Storyboard中 View Controller 的名称设置为ActivityDetailsViewController
.
关于ios - 发送到 destinationViewController 的无法识别的选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22503936/
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isE
有没有办法更改 segue 将在准备 segue 时调用的 Controller ?当使用嵌入式 segue 更改 segmentedcontrol 时,我正在尝试这样做。谢谢! 最佳答案 您可能已经
我正在使用 Spotify API 开发一个 Storyboard应用。我使用这个 ( https://github.com/avazquezpr/SpotifyDemo ) Github 项目作为“
我的应用程序中的 UITableView 是使用 NSFetchedResultsController 进行管理的,我想实现主从行为,但每次我点击单元格时都会收到此 -[UIViewControlle
嘿伙计们,这行代码是做什么的? AddRoleTVC *addRoleTVC = segue.destinationViewController; 我知道第一部分,AddRoleTVC
我试图让我的应用程序同时适用于 iOS7 和 iOS8,但我在 View Controller 中的 prepareForSegue 方法中遇到了问题。 在 iOS8 中 segue.destinat
我正在使用 John Lluch 的 SWRevealViewController这很好用,除了我不知道如何在目标 View Controller 中设置选择器,就像我在其他 UIViewContro
下午好! 我对 Swift 比较陌生,虽然我认为我已经设法解决了大部分问题,但是我在间接设置 segue 的 destinationViewController 时遇到困难。 我知道 destinat
我刚刚意识到下面的代码总是创建一个新的 TagsFeedViewController。这是segues的默认行为吗?有没有办法将 iOS 配置为不每次都创建新的 destinationViewCont
我试图在我的 prepareForSegue 方法中将一个 NSManagedObjectContext 从一个 View Controller 传递到下一个 View Controller ,但我无
我有一个按钮正在连接到一个新的 viewController。当我按下按钮时,在新 View Controller 出现之前会有 3-4 秒的可见延迟。我读过关于 stackoverflow 的其他问
奇怪的问题: 我创建了一个带有两个 View Controller 的 Storyboard,并与自定义转场(交叉溶解)相连。我通过以下方式实现 segue: -(void)transitionToI
我想通过 segue 将我的 View Controller “滑出”到 destinationViewController 上方。这是我的代码: override func perform() {
所以我有一个像这样的 prepareForSegue 方法: override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyOb
我有一个带有三个选项卡的 UITabBarController:每个选项卡都是一个嵌入了 View Controller 的导航 Controller 。目前 tabController 是初始 Vi
我已将 UILongPressGestureRecognizer 添加到我的 UICollectionViewCell 并创建了一个转场,因此通过长按一个 cell 用户转场到一个 View Cont
我已经编写了一个自定义 segue 来获得淡入淡出效果,我试图通过将 destination view controller 插入 source view controller 并设置动画来实现sou
我的代码目前是这样的: override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if
我已经构建了一个侧面菜单,当您单击栏按钮项目时会弹出,单击菜单选项之一后, View Controller 会加载正确的数据,但栏按钮项消失。所以我做了一些研究我发现问题是我的 Segue 目的地,我
我有一个 UICollectionView,当用户按下一个单元格时,我会使用 Storyboard在 UINavigationController 中呈现另一个 View Controller 。 -
我是一名优秀的程序员,十分优秀!