我收到警告,不兼容的指针类型发送'Class‘到'id’类型的参数,在下面的“委托:自我”行:
+ (SHKActionSheet *)actionSheetForType:(SHKShareType)type
{
SHKActionSheet *as = [[SHKActionSheet alloc] initWithTitle:SHKLocalizedString(@"Share")
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:nil];
as.item = [[[SHKItem alloc] init] autorelease];
as.item.shareType = type;此警告在ShareKit中,如果有人知道如何修复它,请让我知道!
发布于 2011-08-09 10:29:21
您正在尝试以静态方法传递self参数。这是不正确的,因为在静态方法中没有这个对象的特定实例。使其成为非静态方法或将该类的某个实例作为委托传递。
发布于 2013-08-19 22:06:55
在使用静态类时,您可以手动获得警告:
delegate:(id<UIActionSheetDelegate>)self发布于 2011-11-04 03:03:50
尝试使用nil而不是self (Xcode4.2 iOS 5)。
https://stackoverflow.com/questions/6990783
复制相似问题