2

I have a MonoTouch project from a year ago which was created as a universal app (but only programmed like a iPhone app. Just in case...) When I uploaded it on an iPad it was shown in this iPhone simulator. I changed the Target from Universal to iPhone/iPod in the IPhone Application Settings in MonoDevelop to achieve this. This seems not to work anymore. Now, when I updated to the latest verion of iOS and MonoTouch the iPad stays white nothing is shown. Which is traceable because i have no code in the AppDelegateIPad.

So my current project exists of the files:

AppDelegateIPad.cs

AppDelegateIPhone.cs

MainWindowIPad.xib

MainWindowIPad.xib.designer.cs

MainWindowIPhone.xib

MainWindowIPhone.xib.designer.cs

Main.cs

MainWindowIPhone.xib contains a NavigationController which will be added with window.AddSubview in AppDelegateIPhone.cs

What is the best, easiest way to convert the project to a iPhone only project. So it runs in the iPhone simulator on iPad?

Thanks in advance!

Krumelur
  • 32,180
  • 27
  • 124
  • 263
Thomas
  • 43
  • 5

1 Answers1

1

You can still keep it as a universal app and target iPhone or iPad only. I'm doing this too. In Monodevelop go to Project Settings -> iPhone Application

  • In the "Devices" drop down select "iPhone".
  • In the section "iPhone Deployment Info" you will have to select the correct main interface. Pick your MainWindowIPhone.xib

That should be all.

If you really want to convert it and remove the code for iPad, follow the steps above, then start removing all iPad related stuff.

One more side note: you should not use window.AddSubview(rootController.View) anymore. Instead use window.RootViewController = rootController;

Krumelur
  • 32,180
  • 27
  • 124
  • 263
  • Thank you. I did these steps on my own from beginning but since the new Version it didn't work. When I set a breakpoint in AppDelegateIPad.cs it stops there. I tried to use the RootViewController abut it couldn't be a NavigationController. (Which is my base class). Do you know a good help regarding RootViewController? – Thomas Dec 15 '11 at 16:19
  • Forget about the last part. I just tried it again and it works now I just use my UINavigationController as RootViewController and it works! – Thomas Dec 15 '11 at 16:31