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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:59:52+00:00 2026-06-16T21:59:52+00:00

I’m writing my own custom alert view for an application. The customer has their

  • 0

I’m writing my own custom alert view for an application. The customer has their own look/feel for alert type messages. I’ve read that subclassing UIAlertView isn’t really a good idea, so I’m just trying to make the current message view I’m using a bit more dynamic so I can reuse it a bit more.

Ok, my question. I am stealing the init from UIAlertView to init my own custom alert.

- (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;

This was taken right out of Apple’s UIAlertView initializer. Mine is going to work just the same, so why not just use their init.

I want to be able to pass in multiple strings for otherButtonTitles, much like UIAlertView. My question is, how do I access the strings being passed in?

  • 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-16T21:59:54+00:00Added an answer on June 16, 2026 at 9:59 pm

    I would may the otherButtonTitles argument a NSArray instead of an NSString. From there you can dynamically generate additional buttons based on the count of the array, and set the title of said button to the NSString stored in current index of the array.

    EDIT: I think I’ve found something promising, in UIAlertView.m (not sure if it’s actually from Apple) but it takes otherButtonTitles as a string as well. It uses a va_list to store the otherButtonTitles, and then add’s the objects to a mutable array that contains all the buttons, including the cancel button at index 0 (if applicable).

    https://github.com/BigZaphod/Chameleon/blob/master/UIKit/Classes/UIAlertView.m

    Here’s an excerpt:

     if (otherButtonTitles) {
            [self addButtonWithTitle:otherButtonTitles];
    
            id buttonTitle = nil;
            va_list argumentList;
            va_start(argumentList, otherButtonTitles);
    
            while ((buttonTitle=(__bridge NSString *)va_arg(argumentList, void *))) {
                [self addButtonWithTitle:buttonTitle];
            }
    
            va_end(argumentList);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
In my XML file chapters tag has more chapter tag.i need to display chapters
I have an array which has BIG numbers and small numbers in it. I
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.