Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7865277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:02:20+00:00 2026-06-03T00:02:20+00:00

I have a Universal (for both iPhone and iPad) application. Are there any advantages

  • 0

I have a Universal (for both iPhone and iPad) application.

Are there any advantages on separating the iPad from the iPhone classes in the folder structure?

Here is an example of what I mean:

- MyApp
    - Resources
    - Classes
        - iPad
            - SomeUniqueClassOnIPad.h
            - SomeUniqueClassOnIPad.m
        - iPhone
            - SomeUniqueClassOnIPhone.h
            - SomeUniqueClassOnIPhone.m
    - SomeUniversalClass.h
    - SomeUniversalClass.m

Is that common in objective-c projects?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:02:22+00:00Added an answer on June 3, 2026 at 12:02 am

    One of the rules within coding is never to have duplicate code, so if your views are doing different things or if data should be handled differently depending on if its an iPad or iPhone (e.g. different data sources?) it should definitely be in different classes, if not.. then no. Use one and the same class.

    One thing that is common and which you could implement in such case is a kind of helper, a delegate class if you will, which handles all the common methods and actions that take place in your code.

    Golden rule: Write as little code as possible! Less code == more maintainable and has a higher quality. So write as little code as possible yet without affecting your requirements.
    Also, split up code so its easier to (unit)test and thereby easier to re-use.

    I hope that answered your question.

    Update
    I know there was a terminology for this, just could think of it. Having duplicate code is called “a DRY-violation”. DRY stands for Don’t Repeat Yourself which is a principle of software development aimed at reducing repetition of information of all kinds, especially useful in multi-tier architectures.
    More information: DRY on Wikipedia

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made my application universal for iPhone and iPad (window-based application; universal) from
I have the universal application both for iPhone and iPad. I need to have
If I have a universal app (runs on both iPhone & iPad), how do
I have a Core Data app that will end up being an iPhone/iPad universal
I have a universal app which supports both orientations and all resolutions, so there
I'm creating an universal application and my CCMenu appears just fine on both iPhone,
I have a universal binary application and currently working on the iPad version of
I have a universal iPhone/iPad app. On the main menu I have a UIImage
I have a Universal app (iPhone/iPad) which has an iAd displayed at the bottom
I have a Universal app (iPhone/iPad) testing on IOS4.3. It has an iAd which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.