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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:31:04+00:00 2026-06-04T03:31:04+00:00

Is this true? When you instantiate a UIAlertButton, you have to pass it an

  • 0

Is this true? When you instantiate a UIAlertButton, you have to pass it an explicit title for the Cancel button, like so:

UIAlertView *av = 
    [[UIAlertView alloc] 
         initWithTitle:@"Error" 
         message:err.localizedDescription 
         delegate:nil 
         cancelButtonTitle:@"Cancel" 
         otherButtonTitles:nil];

That means that if you want a localized app (which of course you do), you have to localize the Cancel string too, even though Apple has obviously got a canonical translation already. Am I really forced to write something like this to handle it (or is this even OK)?

NSBundle* uikitBundle = [NSBundle bundleForClass:[UIButton class]];
UIAlertView *av = 
    [[UIAlertView alloc] 
         initWithTitle:NSLocalizedString(@"Error", @"Title for Alert box when error occurs") 
         message:err.localizedDescription 
         delegate:nil 
         cancelButtonTitle:NSLocalizedStringFromTableInBundle(@"Cancel", @"Localizable", uikitBundle, nil) 
         otherButtonTitles:nil];

This looks horrible to me, but the idea that I have to maintain my own translations of words mandated by Apple’s HIG (like “Cancel” or “OK”) seems equally absurd.

  • 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-04T03:31:05+00:00Added an answer on June 4, 2026 at 3:31 am

    As you expect, that’s not recommended as your code introduces an undocumented, unsupported dependency which could break your app if a future iOS update comes along that changes how Apple localizes their UIButton (not very likely, but who knows).

    Really, “OK” and “Cancel” are not difficult things to translate. If you don’t wish a translator to re-localize these for you as part of your app’s localization work then you could retrieve these yourself from iOS (using your code) and copy the translation to your .strings file, so that you’ll have a reliable copy of the translation from now on!

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

Sidebar

Related Questions

I am currently writing my python classes and instantiate them like this class calculations_class():
In java, I can write code like this Boolean b = true ; And
We have a class like this: class LogAnalyzer { protected IExtensionManager manager; public LogAnalyzer()
I have an Android WebView. I pass HTML to it (as a String). This
Is this true that Update SQL Query is slow because of Clustered index??????
How do I convert this: [True, True, False, True, True, False, True] Into this:
Duplicate In C arrays why is this true? a[5] == 5[a] Given an array
Some claim that appending to immutable lists is more efficient. Is this true? How?
I heard that SQL is faster if table relationships are defined. Is this true?
I've been told that defragging causes the log to grow tremendously. Is this true?

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.