0

Sprite *shipViewTemp = [[UIImageView alloc] initWithImage:(UIImage *) ship];

这是我的代码中唯一的错误,有人可以帮忙吗?

xcode 说

不兼容的指针类型

4

1 回答 1

0

查看 Xcode 给你的完整错误。通常,错误/警告会告诉您究竟出了什么问题。在这种情况下,完整的错误很可能是:

Incompatible pointer types initializing 'Sprite' with an expression of type 'UIImageView *'

在这种情况下,它告诉您您正在尝试将 的实例分配给UIImageView期望Sprite. (在下面的屏幕截图中,我使用NSString了 ,但您会看到与 类似的内容Sprite。)

在此处输入图像描述

于 2013-07-24T17:22:33.090 回答