tags:

views:

25

answers:

2

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

In viewcontroller1.m file , i 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?

+1  A: 

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.

ennuikiller
Yes, odds are that he's returning an NSNumber from that method, rather than a boolean value. In that case, calling boolValue on the result of the method should do the trick.
Brad Larson
if anyone cares, BOOL is a signed char on the iPhone
jessecurry
A: 

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.

Tony Lambert