1. 程式人生 > >Xcode工程編譯錯誤之iOS開發之Sending '__strong typeof (xxx)' (aka 'xxxx *__strong') to parameter of incompatible type 'id<xxx>'

Xcode工程編譯錯誤之iOS開發之Sending '__strong typeof (xxx)' (aka 'xxxx *__strong') to parameter of incompatible type 'id<xxx>'

ram 分享 一行 警告 解決 class send 文件 interface

iphone開發出現警告:

Sending ‘__strong typeof (xxx)‘ (aka ‘xxxx *__strong‘) to parameter of incompatible type ‘id<xxx>‘

如圖:

技術分享圖片

原因是沒有在頭文件實現相應協議。

解決方法是在頭文件(.h文件)中

@interface 一行後面加上 <協議名>

如圖:

技術分享圖片

Xcode工程編譯錯誤之iOS開發之Sending '__strong typeof (xxx)' (aka 'xxxx *__strong') to parameter of incompatible type 'id<xxx>'