简体   繁体   中英

iOS Universal App question

I have submitted my iPad app to apple and got approved. Now, i want to add iPhone support to the App.

My question no.1 is:

Q1. is it possible to make the app universal at this moment after submission?

If yes, i have question no.2

Q2. my iPhone app is exactly the same as the the iPad but only a few views are in different look due to the customization in screen size. What should I do in XCode to specify which class that iPhone/iPad is using respectively? I can build them smoothly when i separated them into 2 projects.

Thank you.

You can modify the same application and add support of other device. you need to resubmit application again.

From with in your code you can detect on which type of device it is executing and based on that you can load appropriate XiB file for each view controller.

Q1--Yes...you need to upgrade target for iPhone. & submit to appStore as universal App.

Q2.You can load Xib to particular device using answer of Question about UIWebview and Universal Application

Yes.It's easy. you have to create Universal app

File--->newproject-->Windowsbasedapplication

and then you select Product type Universal You have a separate view for iphone as well as
ipad

You can identify device using this

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
    // iPad stuff
  }
  else {
    // iPhone/iPod stuff
  }

Most of the UI stuff can be redone just with autosizing parameters, but some don't.

Also for specific classes that do not exist in iPhone/iPod (like UISplitViewController) you can use NSClassFromString , which will return the object class or nil if cannot be loaded.

Q1: Yes, just convert your project to universal and submit it with the same id.

Q2: Fairly easy, conver your project into universal by following the steps here (http://useyourloaf.com/blog/2010/4/7/converting-to-a-universal-app-part-i.html). The basic idea is to extract your business logic from controllers and use different controller for iPhone and iPad. Don't try to implement it with code block like that

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
     // ipad goes here
}
else
{
     // other
}

note: If you google it, you will find this link, don't use it, it is outdated -- http://iphonedevelopment.blogspot.com/2010/04/converting-iphone-apps-to-universal.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM