For Question About a Warning In Objective-c Coding
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.
精彩评论