The*_*ner 12 iphone uiactionsheet ios
我有一个UIActionSheet,我正在指定取消按钮但是当它点击时它不会被忽略?
UIActionSheet *actionSheet = [[[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Target Complete" otherButtonTitles:nil] autorelease];
[actionSheet showInView:self.view];
Run Code Online (Sandbox Code Playgroud)
根据文档,我不需要任何代码,甚至当我尝试实现didCancel委托方法时,它从未调用过?
nev*_*ing 42
试试这个
[actionSheet showInView:[self.view window]];
Run Code Online (Sandbox Code Playgroud)
hac*_*ack 14
这将成功
[actionSheet showInView:[self.view window]];
Run Code Online (Sandbox Code Playgroud)
代替
[actionSheet showInView:self.view];
Run Code Online (Sandbox Code Playgroud)