本文介绍了“没有以前的功能原型”警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用shareKit给自己编程。



但是在FBConnectGlobal中,有一些警告,

  NSMutableArray * FBCreateNonRetainingArray(){
CFArrayCallBacks callbacks = kCFTypeArrayCallBacks;
callbacks.retain = RetainNoOp;
callbacks.release = ReleaseNoOp;
return(NSMutableArray *)CFArrayCreateMutable(nil,0,& callbacks);
}

就像这种方法一样,它警告:之前没有函数FBCreateNonRetainingArray的原型

解决方案

为了澄清Eric Dchao上面的回答,facebook上有人显然没有在BOOL面前放置静态? / p>

无论如何,改变这个

  BOOL FBIsDeviceIPad(){
#if __IPHONE_OS_VERSION_MAX_ALLOWED> = 30200
if(UI_USER_INTERFACE_IDIOM()== UIUserInterfaceIdiomPad){
返回YES;
}
#endif
返回NO;
}

到此

  static BOOL FBIsDeviceIPad(){
#if __IPHONE_OS_VERSION_MAX_ALLOWED> = 30200
if(UI_USER_INTERFACE_IDIOM()== UIUserInterfaceIdiomPad){
返回YES;
}
#endif
返回NO;
}

为我修好了。


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?

Anyways, 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.

这篇关于“没有以前的功能原型”警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 17:34