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 7566035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:18:35+00:00 2026-05-30T14:18:35+00:00

On iOS there is this nice feature that an app developer can specify device-specific

  • 0

On iOS there is this nice feature that an app developer can specify device-specific resources or keys in Info.plist by tacking on a device-specific suffix to the base name of the resource or key. Currently we have ~ipad and ~iphone.

I would like to use the same system for some of my app’s registration domain user defaults that should have different values on the various devices. Do you know of a function or method in iOS that I can call to get the current device suffix? Although it is simple to code this myself, I prefer to use the system API whenever that is possible.

I don’t really care whether the system gives me ~ipad and ~iphone, the strings just need to be unique for each device. I also prefer something that is human readable, which is why I am not enthusiastic about using UIDevice.userInterfaceIdiom (that’s just a number). I also looked at UIDevice.model but I am unsure if this would be suitable.

  • 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-05-30T14:18:37+00:00Added an answer on May 30, 2026 at 2:18 pm

    Just in case there is no positive answer, this is how my implementation of the desired function looks:

    // NSStringAdditions.h
    @interface NSString(NSStringAdditions)
    - (NSString*) stringByAppendingDeviceSuffix;
    @end
    
    
    // NSStringAdditions.m
    - (NSString*) stringByAppendingDeviceSuffix
    {
      static NSString* deviceSuffix = nil;
      if (! deviceSuffix)
      {
        if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
          deviceSuffix = @"~iphone";
        else
          deviceSuffix = @"~ipad";
      }
      return [self stringByAppendingString:deviceSuffix];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that iOS app icons are automatically cropped to the nice rounded shape
I have a nice little app on the app store that does pretty well
There's this method in UIColor in iOS 5: - (BOOL)getHue:(CGFloat *)hue saturation:(CGFloat *)saturation brightness:(CGFloat
For iPhone and iPad i.e iOS development Is there a specific server platform required
I am designing an iOS app using XCode 4.2's storyboard feature. The app has
Is there an official Twitter SDK for iOS? If so, where can I possibly
I have this code in my iOS app: - (IBAction)cameraButtonPressed:(id)sender { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]
This question is related to a iOS project written in ObjectiveC that makes use
Under iOS there are several built in hooks for launching service-specific apps based on
There is a nice Sea Stars iOS application out there, with a good looking

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.