不兼容的指针类型,使用UIActionSheet类型的表达式初始化TaggedUIActionAheet

时间:2012-09-26 16:52:45

标签: objective-c xcode uiactionsheet

当我运行时:

TaggedUIActionSheet *sheet = [[UIActionSheet alloc] 
        initWithTitle:nil
        delegate:self 
        cancelButtonTitle:@"Cancel" 
        destructiveButtonTitle:@"Delete" 
        otherButtonTitles:@"Save to photos",@"Email",nil];

我收到以下错误:

Incompatible pointer type initializing TaggedUIActionAheet with an expression of type UIActionSheet

2 个答案:

答案 0 :(得分:1)

发现第一行中的错误:

TaggedUIActionSheet *sheet = [[UIActionSheet alloc]

应该是:

TaggedUIActionSheet *sheet = [[TaggedUIActionSheet alloc] 

答案 1 :(得分:0)

请尝试以下操作:

 UIActionSheet *Actionsheet =[[UIActionSheet alloc]initWithTitle:title delegate:delegate cancelButtonTitle:Canclebutton destructiveButtonTitle:destructivebutton otherButtonTitles:nil, nil];

[Actionsheet showInView:self.view];

-(void)Click_Button:(UIButton*)sender
{
    [self ShowActionsheet:@"Do u Want to Delete This Record!!!" Delegate:self canclebutton:@"Cancle" Destructivebutton:@"Yes"];
}