i use shareKit to myself program .
but in the FBConnectGlobal, there are some warning,
NSMutableArray* FBCreateNonRetainingArray() {
CFArrayCallBacks callbacks = kCFTypeArrayCallBacks;
callbacks.retain = RetainNoOp;
callbacks.release = ReleaseNoOp;
return (NSMutableArray*)CFArrayCreateMutable(nil, 0, &callbacks);
}
like this method, it warning:"No previous prototype for function FBCreateNonRetainingArray"
To clarify Eric Dchao's answer above, someone at facebook apparently didn't put a "static" in front of that BOOL?
ReplyDeleteAnyways, changing from this
BOOL FBIsDeviceIPad() {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
return YES;
}
#endif
return NO;
}
to this
static BOOL FBIsDeviceIPad() {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
return YES;
}
#endif
return NO;
}
fixed it for me.
In Xcode 4, go to your project's Build Settings. Search for "prototype". There should be an option called "Missing Function Prototypes"; disable it.
ReplyDeletevia here
According to c standard, declaring the prototype as
ReplyDeleteNSMutableArray* FBCreateNonRetainingArray(void);
// ---------------> ^^^^
// Yes, with the void as the parameter
solves the issue.
Is it a global function? Add "static" if it is only used in the current file.
ReplyDeleteThe possible reason is as below:
no previous prototype for `foo'
This means that GCC found a global function definition without seeing a prototype for the function. If a function is used in more than one file, there should be a prototype for it in a header file somewhere. This keeps functions and their uses from getting out of sync
If the function is only used in this file, make it static to guarantee that it'll never be used outside this file and document that it's a local function
@daveswen - You got it. That's the way to do it, if there are arguments, just declare the function in the .h file if there aren't any arguments in the method signature, just out void inside the argument block and declare it in the header again.
ReplyDelete