gpt4 book ai didi

annotations - 在没有 segue anchor 的 mapkit 注释上定位 segue popover

转载 作者:行者123 更新时间:2023-12-05 01:13:01 26 4
gpt4 key购买 nike

我在 xCode 4.2 中有一个使用 Storyboard的项目。我正在使用 mapkit 框架。我正在尝试通过用户使用 segue 选择的注释来定位弹出窗口。

这是我的。

if([view.annotation isKindOfClass:[ContentPoint class]]) {
NSLog(@"I see this in my log");

[self performSegueWithIdentifier:@"ViewAudioSegue" sender:mapView.selectedAnnotations];
}

这调用了正确的 segue,但是因为 segue 有一个 mapview 的 anchor ,所以弹出窗口显示在 map 的底部而不是在选定的注释旁边。我尝试了不同的发件人( View 、 map 等),但我得到了相同的结果。有没有办法以编程方式设置 anchor ?这是我在没有手动设置 anchor 时遇到的错误“* 由于未捕获的异常‘NSInternalInconsistencyException’而终止应用程序,原因:‘UIStoryboardPopoverSegue 必须从栏按钮项或 View 中呈现。’”

最佳答案

我找到了答案

MapKit deselect Annotation and popover does not animate

它不使用 segues,但它允许我删除项目中的所有 nib 文件并只使用 Storyboard。

关于annotations - 在没有 segue anchor 的 mapkit 注释上定位 segue popover,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9538733/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com