iphone - Call function from UIActionSheet -
i have stupid problem uiactionsheet. want function "sendmail" launched clicking on first button of action sheet.
so here did :
- (void)actionsheet:(uiactionsheet *)actionsheet clickedbuttonatindex:(nsinteger)buttonindex{ nslog(@"%d", buttonindex); if (buttonindex == 0) { sendmail(); } }
i declared function sendmail in .h file, contains :
-(void)sendmail; -(void)actionsheet;
when want build , run, have following error :
undefined symbols: "_sendmail", referenced from: -[my1viewcontroller actionsheet:clickedbuttonatindex:] in my1viewcontroller.o ld: symbol(s) not found collect2: ld returned 1 exit status
i don't understand going on. if copy/paste what's inside sendmail function inside (void)actionsheet function, works charm. looks call of sendmail function problem, , don't understand why.
thanks !
objective-c calls methods not functions , it's this:
[self sendmail];
Comments
Post a Comment