开发者

For Question About a Warning In Objective-c Coding

开发者 https://www.devze.com 2022-12-11 03:46 出处:网络
I have one file viewcontroller.h and .m and viewcontroller1.h and .m In viewcontroller1.m file , i 开发者_Python百科write function like BOOL rechable = [viewcontroller functionrechable];

I have one file viewcontroller.h and .m and viewcontroller1.h and .m

In viewcontroller1.m file , i 开发者_Python百科write function like BOOL rechable = [viewcontroller functionrechable];

it gives me warning like warning:initialization makes integer from pointer without a cast

how to remove this warning??? is it any way to do it?


This is telling you that your defining reachable as a BOOL type which really resolves to an integer typye, yet the [viewcontroller functionrechable] message is returning a pointer. You can remove the warning either by casting the return type of the function to BOOL or int, or changing the type of reachable to a pointer.


What is the definition for the method [viewcontroller functionrechable]....

The solution is most likely:

BOOL rechable = (BOOL) [viewcontroller functionrechable];

But I would need the definition to be sure.

0

精彩评论

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