Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to resolve warning implicit declaration of function in Objective C

log

warning: implicit declaration of function 'TutorialAlertWithMessageAndDelegate'

here my code

.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];
}
like image 236
RAGOpoR Avatar asked Feb 13 '10 05:02

RAGOpoR


1 Answers

That warning is generated when you try to call a function before declaring it. Your declaration in the header (.h) file seems to be correct, but you are probably not including that header file in the source file that is calling the function. Be sure to put:

#include "Tutorial.h" // replace with actual filename, of course

at the top of that source file.

like image 180
benzado Avatar answered Oct 15 '22 06:10

benzado