0

I want to build a UIPickerView with ActionSheet. Some codes was found in Stack Overflow (link Problem in Datepicker and alertsheet)

Error occured when I tried to use it. It showed iRolegameAppDelegate was not defined.

-(IBAction)DatePickerView {iRolegameAppDelegate *appDelegate = (iRolegameAppDelegate *)[[UIApplication sharedApplication]delegate];
pickerViewDate = [[UIActionSheet alloc] initWithTitle:@"How many?"
                                             delegate:self
                                    cancelButtonTitle:nil
                               destructiveButtonTitle:nil
                                    otherButtonTitles:nil]; 

Is there anyone can tell me how to define it?

Thank you.

Community
  • 1
  • 1
Welbin
  • 9
  • 4

1 Answers1

0

That is presumably your application delegate. You need to import the header file:

#import "iRolegameAppDelegate.h"

At the top of the .m file this method is in.

If that isnt your app delegate, then you are copying from an example you don't understand.

jrturton
  • 118,105
  • 32
  • 252
  • 268