开发者

"Assignment from distinct type" warning message

开发者 https://www.devze.com 2022-12-11 05:06 出处:网络
I am getting the following warning: assignment from distinct objective-c type How d开发者_C百科o I fix this?There are many ways to get this error, so it\'s helpful if you post some code...

I am getting the following warning:

assignment from distinct objective-c type

How d开发者_C百科o I fix this?


There are many ways to get this error, so it's helpful if you post some code... That said, you're probably doing something like:

UIView *bladyblah;
bladyblah = [[MyViewType alloc] init];

i.e. assigning an object of one type into a variable of another type. the fix is either to change the type of the variable, or do a type cast like so:

bladyblah = (UIView *)[[MyViewType alloc] init];


You have to check the correctness of the types you are assigning and if needed you have to do an operation of casting! If you post your code it's more easy to help you!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号