RAG*_*poR 11 iphone objective-c
日志
warning: implicit declaration of function 'TutorialAlertWithMessageAndDelegate'
Run Code Online (Sandbox Code Playgroud)
我的代码
.h
void TutorialAlertWithMessageAndDelegate(NSString *title, NSString *message, id delegate);
.m
void TutorialAlertWithMessageAndDelegate(NSString *title, NSString *message, id delegate)
{
/* open an alert with OK and Cancel buttons */
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title
message:message
delegate:delegate
cancelButtonTitle:@"Dismiss"
otherButtonTitles: @"Show Tutorial", @"Disable Tutorial", nil];
// otherButtonTitles: @"Show Next Tip", @"Disable Tips", nil];
[alert show];
[alert release];
}
Run Code Online (Sandbox Code Playgroud)
ben*_*ado 12
当您在声明函数之前尝试调用函数时会生成该警告.标题(.h)文件中的声明似乎是正确的,但您可能不会在调用该函数的源文件中包含该头文件.一定要把:
#include "Tutorial.h" // replace with actual filename, of course
Run Code Online (Sandbox Code Playgroud)
在该源文件的顶部.
| 归档时间: |
|
| 查看次数: |
36311 次 |
| 最近记录: |