(轉(zhuǎn)自:http://blog.sina.com.cn/s/blog_af73e7a70101bh4m.html,感謝作者)
在編譯《iphone開(kāi)發(fā)秘籍》第八章的秘訣一的代碼時(shí)碰到以下警告錯(cuò)誤:
CGPoint randomPoint()
{
int half = 32;
int freesize = 240 - 2 * half;
return CGPointMake(random() % freesize + half, random() % freesize + half);
}
warning:No previous prototype for function "randomPoint"。如何取消這個(gè)警告錯(cuò)誤呢?方法嘗試了這兩種都可以:
1.方法上加修飾符static
2.或者Project-Info -> TARGETS ->Build Settings -> LLVM GCC4.2 - Warnings組 -> Missing Function Prototypes Yes->No