Ios UIActionSheet showInView发出警告:无效上下文0x0
我正在尝试在self.view.parentview中显示UIActionSheet。但我在跑步时没有得到警告Ios UIActionSheet showInView发出警告:无效上下文0x0,ios,datepicker,uiactionsheet,Ios,Datepicker,Uiactionsheet,我正在尝试在self.view.parentview中显示UIActionSheet。但我在跑步时没有得到警告 <Error>: CGContextSetFillColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to a
<Error>: CGContextSetFillColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextSetStrokeColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
我已经设置了断点。但是在这一行[self.dobActionSheet showInView:self.parentViewController.view]中得到这个警告
我尝试在Viewcontroller中演示,它在第一个索引中嵌入在tabbarController中。这就是为什么,尝试使用parentViewController.view而不是self.view进行演示
注:我也看到了同样的问题。但是找不到答案
actionSheet = [[UIActionSheet alloc] initWithTitle:@"Title"
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:@"Ok"];
使用@
我已经从@Sunny shah answers解决了这个问题。我试过他的答案,但行动表上有标题。相反,我尝试使用下面的代码。标题名为单个空格
self.dobActionSheet = [[UIActionSheet alloc] initWithTitle:@" " delegate:nil cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil,nil];
尝试使用[self.dobActionSheet showInView:self.view];我不能这么做。因为此viewcontroller在第一个索引时嵌入在tabbarcontroller中。这是正确的方法吗?不管怎么说,我都试过了,但还是犯了同样的错误!!可能重复:@c0ming谢谢你的链接。我已经试过了,但对我来说不起作用。动作单显示标题。。所以我试着用单个空格作为标题。它起作用了。看看我的答案。。感谢+1为你:
actionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:nil
cancelButtonTitle:@""
destructiveButtonTitle:nil
otherButtonTitles:nil];
self.dobActionSheet = [[UIActionSheet alloc] initWithTitle:@" " delegate:nil cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil,nil];