3

I am working in iPhone application, Using Xcode 4.3.2 tool to develop it, Using universal application to create this application, but only one Appdelegate (i am using this appdelegate for iPhone) show in the project navigator, but i want another one Appdelegate for iPad, How to create this? please help me

Thanks in Advance

Screen shots for your reference:

enter image description here

enter image description here

enter image description here

SampathKumar
  • 2,525
  • 8
  • 47
  • 82
  • iPad and iPhone targets typically share the same app delegate you just check which idiom to determine what views you want to display. – Joe Sep 08 '12 at 05:18
  • 1
    Wow. I don't think you can do this, but I look forward to reading that I'm wrong. (Also, great question.) – Steven Fisher Sep 08 '12 at 05:18

1 Answers1

1

Use below code may be help you

id<UIApplicationDelegate> delegate = [[UIApplication sharedApplication] delegate]; 
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    AppDelegate_iPad *appDelegate = (AppDelegate_iPad *) delegate;
else
    AppDelegate_iPhone *appDelegate = (AppDelegate_iPhone *) delegate;
Dipen Chudasama
  • 3,063
  • 21
  • 42