当我使用此代码创建弹出窗口时,在使用视图控制器初始化 UIPopoverController 后会出现 sigabrt 错误
当我使用此代码进行弹出窗口创建时,它在初始化后给出 sigabrt 错误 带有视图控制器的 UIPopoverController(测试2),
Test2 *pop=[[Test2 alloc]initWithNibName:@"Test2" bundle:nil];
popUpnew=[[UIPopoverController alloc] initWithContentViewController:pop];
popUpnew.delegate=self;
popUpnew.delegate=self;
popUpnew.popoverContentSize=CGSizeMake(150,75);
[popUpnew presentPopoverFromRect:mybutton.frame inView:self.view permittedArrowDirections:
UIPopoverArrowDirectionAny animated:YES];
when i am using this code for pop up creation it is giving sigabrt error after initializing
UIPopoverController with a view controller(Test2),
Test2 *pop=[[Test2 alloc]initWithNibName:@"Test2" bundle:nil];
popUpnew=[[UIPopoverController alloc] initWithContentViewController:pop];
popUpnew.delegate=self;
popUpnew.delegate=self;
popUpnew.popoverContentSize=CGSizeMake(150,75);
[popUpnew presentPopoverFromRect:mybutton.frame inView:self.view permittedArrowDirections:
UIPopoverArrowDirectionAny animated:YES];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你这里的看起来不错。您是否检查过 mybutton.frame 和 self.view 是否有效?调用presentPopoverFromRect后立即释放了吗?
您是否尝试过通过将委托设置为零来进行测试?
What you have here looks fine. Have you checked to see that mybutton.frame and self.view are valid? Did you release it immediately after calling presentPopoverFromRect?
Have you tried testing by setting the delegate to nil?
试试这个
Try this