Is it possible to create UIActionSheet buttons dynamically?

In this case, I'm trying to do the following:
NSMutableArray *btnAry = [[NSMutableArray alloc] init];
[btnAry addObject:@"button1"];
[btnAry addObject:@"button2"];
[btnAry addObject:@"button3"];
UIActionSheet *emailAction = [[UIActionSheet alloc] initWithTitle:title delegate:(id)self cancelButtonTitle:cancel destructiveButtonTitle:nil otherButtonTitles:btnAry];
The error I get here is: 'NSInvalidArgumentException', reason: '* -[NSCFArray length]: unrecognized selector sent to instance 0x459dd10'
I'm trying to basically create the action sheet based on the values in the array, which is dynamically set at runtime. I have tried using addButtonWithTitle, but the problem with this solution, is that I cannot specify the index of the cancel button without writing some hokie code...
It seems the easiest way would be to be able to somehow setup the UIActionSheet on init with the values for the buttons.
any thoughts on how to achieve this would be much appreciated....

In this case, I'm trying to do the following:
NSMutableArray *btnAry = [[NSMutableArray alloc] init];
[btnAry addObject:@"button1"];
[btnAry addObject:@"button2"];
[btnAry addObject:@"button3"];
UIActionSheet *emailAction = [[UIActionSheet alloc] initWithTitle:title delegate:(id)self cancelButtonTitle:cancel destructiveButtonTitle:nil otherButtonTitles:btnAry];
The error I get here is: 'NSInvalidArgumentException', reason: '* -[NSCFArray length]: unrecognized selector sent to instance 0x459dd10'
I'm trying to basically create the action sheet based on the values in the array, which is dynamically set at runtime. I have tried using addButtonWithTitle, but the problem with this solution, is that I cannot specify the index of the cancel button without writing some hokie code...
It seems the easiest way would be to be able to somehow setup the UIActionSheet on init with the values for the buttons.
any thoughts on how to achieve this would be much appreciated....

Similar Messages

  • Is it possible to create custom buttons in CRM Ondemand?

    Hi,
    Is it possible to create custom buttons in CRM Ondemand in any detail page like the inbuilt buttons like 'New', 'Delete' etc? If possible then how?
    Thanks
    Arpita

    You can add a button using custom javascript. but this could potentially have performance issues. please test the performance and functionality if you implement a lot javascript
    see this link : http://helponmyproject.com/TTOCOD/
    Regards,
    Royston

  • Create Radio button dynamically in Table column.

    HI All
       I have used following code to create radio button dynamically. but it's getting dump saying that Could not find attribute STATUS. 
    Here STATUS is the attribute of the node in View context. But why this dump is coming. 
    Please correct me if any thing worng.
      DATA: lr_radio TYPE REF TO cl_wd_radiobutton.
      DATA: lr_containr TYPE REF TO cl_wd_transparent_container.
      DATA: lr_data TYPE REF TO cl_wd_flow_data.
      IF first_time = abap_true.
        lr_containr ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
        lr_radio = cl_wd_radiobutton=>new_radiobutton(
        view = view
        id = 'RADIO'
        text = 'Enroll'
        bind_selected_key = 'STATUS'
        key_to_select = 'STATUS' ).
        lr_data = cl_wd_flow_data=>new_flow_data( element = lr_radio ).
        lr_radio->set_layout_data( lr_data ).
        lr_containr->add_child( lr_radio ).
      ENDIF.
    Thank you very much
    Ram

    Hi Rama,
    I solved it.check this code.
    i think u did mistake in creating radio button you are not passing the 
    BIND_KEY_TO_SELECT
      instead you are passing KEY_TO_SELECT.
    data:lr_column2 type ref to cl_wd_table_column,
         lr_radio type ref to cl_wd_radiobutton.
       lr_column2 = obj_table->get_column(
                   id         = 'TABLE1_PLANETYPE'
    *              INDEX      = INDEX
    lr_radio = cl_wd_radiobutton=>new_radiobutton(
    *      BIND_ENABLED        = BIND_ENABLED
           BIND_KEY_TO_SELECT  = 'STATUS'
    *      BIND_KEY_VISIBLE    = BIND_KEY_VISIBLE
    *      BIND_READ_ONLY      = BIND_READ_ONLY
           bind_selected_key   = 'STATUS'
    *      BIND_STATE          = BIND_STATE
    *      BIND_TEXT           = BIND_TEXT
    *      BIND_TEXT_DIRECTION = BIND_TEXT_DIRECTION
    *      BIND_TOOLTIP        = BIND_TOOLTIP
    *      BIND_VISIBLE        = BIND_VISIBLE
    *      ENABLED             = ABAP_TRUE
    *      EXPLANATION         = EXPLANATION
           ID                  = 'RAD1'
    *      KEY_TO_SELECT       = KEY_TO_SELECT
    *      KEY_VISIBLE         = KEY_VISIBLE
    *      ON_SELECT           = ON_SELECT
    *      READ_ONLY           = READ_ONLY
    *      STATE               = E_STATE-NORMAL
           TEXT                = 'Test'
    *      TEXT_DIRECTION      = E_TEXT_DIRECTION-INHERIT
    *      TOOLTIP             = TOOLTIP
    *      VIEW                = VIEW
    *      VISIBLE             = E_VISIBLE-VISIBLE
    lr_column2->set_table_cell_editor( the_table_cell_editor = lr_radio  ).
    Thanks,
    Suman

  • Is it possible to create a button??

    hi
    is it possible to create a button in the midlet (j2me) ????
    thanks

    Please see this thread http://forum.java.sun.com/thread.jspa?threadID=635335&tstart=30

  • Is it possible to create a button which goes back to the previous page?

    I would like to create a button which sits within a interactive pdf page that on click will return me to my previously visited page.
    As the page will be able to be accessed via numerous other pages the traditional built in Execute menu action is not suitable.
    The page which will be displayed (on click of a button) is a series of mattress sizes which i want to be accessable by each bed product in our collection. Once the user has looked at the mattress size guide i want them to be able to return to the bed product that they were looking at originally, without having to then scroll and search.
    Is this possible with some javascript trickery?
    i found this script:
    history.go(-1);
    But allas acrobat was not fond of it.
    PLEASE HELP!
    Thanks in advance.

    PDFs are not HTML documents. HTML has no concept of a physical page and PDF only knows a page canvas.
    You can access the page number property of the doc object and you can set the page number of the page number of the doc object. The page number in Acrobat JavaScript is zero base, the first page is 0.
    To get the page number one uses the following code:
    this.pageNum;
    To set the page number one uses:
    this.pageNum = 0; // goto first page
    To goto the next page:
    this.pageNum = this.pageNum++ // increment the page number and goto that page
    To goto the last page:
    this.pageNum = this.numPages--; // decrement the total number of pages
    To goto the previous page:
    this.pageNum = this.pageNum--; // decrement the page number

  • Edit button in uitableview (possible to create custom buttons)

    Hi
    Instead of Edit button in the UiTableView, we can create a custom buttons. Basically once we clicked the edit button it shows the option (delete button) to delete the corresponding row.
    Like that is it possible to create a custom button? Clicked on custom button, instead of delete button can we show other buttons (ok/cancel), rather than delete we can do any other action?
    Thanks
    mindus

    You can add a button using custom javascript. but this could potentially have performance issues. please test the performance and functionality if you implement a lot javascript
    see this link : http://helponmyproject.com/TTOCOD/
    Regards,
    Royston

  • Is it possible to create custom buttons for quizzes in Adobe Presenter?

    My company is not happy with the quiz buttons in Adobe Presenter and I was wondering if it is possibe to create custom buttons for quizzes and use them as defaults. Like you can do in Captivate.  I'm using Adobe Presenter 8 in Windows 7. 

    Hi,
    Do you want to change the appearance and position of buttons ?
    or
    Do you want to change the action when the button is pressed ?
    Thanks,
    Alpi Agarwal

  • Is it possible to create a button animation on 'highlight'?

    I've created my menu in Photoshop and I would like to have my polaroid buttons move slightly/wiggle when 'highlighted', not necessarily selected. Is there a way to create these animations in After Effects and integrate them into Encore?
    If not, is there a way to have the video buttons not begin playing until highlighted?
    Any help would be grately appreciated! Thank you very much!
    Erin

    Not directly, but you can try the following.  You can use autoactivate to go to a different menu that has the "selected" picture in motion.  You have six pictures, so you have the original (all still menu), then 6 more, each with a different motion background in which the picture moves.  All buttons are able to be clicked in every menu.
    This works in a DVD, but not on a computer, unless the user uses a remote type function.  (Mouse over won't autoactivate.)

  • Hi guys, This is very urgent, Creating radio button dynamically.

    Hi guys,
    I have this requirement where i need to access a table and depending on the possible answers for that question i need to display radio buttons on the next screen.
    lets say if i have the possible answers as YNX. i have to display three radio buttons besides the text one for YES, one for NO, one for N/A. I know this is kind of tricky but one more thing. if the possible answers are YN then i shud only have 2 radiobuttons one YES, one NO.
    and there are not only one text that im printing but there are multiple texts and radio buttons for each of them besides it.
    its urgent,
    Thanks

    Hi,
    here a short example:
    DATA: BEGIN OF SPOPLIST OCCURS 15.
            INCLUDE STRUCTURE SPOPLI.
    DATA: END   OF SPOPLIST.
    DATA: ANTWORT TYPE C.
    DATA: VALUE(3).
    VALUE = 'YNX'.
    SPOPLIST-VAROPTION = 'Yes'.
    APPEND SPOPLIST.
    SPOPLIST-VAROPTION = 'No'.
    APPEND SPOPLIST.
    IF VALUE = 'YNX'.
      SPOPLIST-VAROPTION = 'N/A'.
      APPEND SPOPLIST.
    ENDIF.
    CALL FUNCTION 'POPUP_TO_DECIDE_LIST'
      EXPORTING
        TITEL            = 'Set your Answer'
        TEXTLINE1        = 'Please select'
        TEXTLINE2        = 'You can chosse this'
        TEXTLINE3        = 'Options'
      IMPORTING
        ANSWER           = ANTWORT
      TABLES
        T_SPOPLI         = SPOPLIST
      EXCEPTIONS
        TOO_MUCH_ANSWERS = 1
        TOO_MUCH_MARKS   = 2.
    IF ANTWORT = 'A'.
      WRITE: 'Popup canceled.'.
    ELSE.
      WRITE: 'This is select:'.
      LOOP AT SPOPLIST WHERE SELFLAG = 'X'.
        WRITE: SPOPLIST-VAROPTION.
      ENDLOOP.
    ENDIF.
    in the Docu of the FM there is another example with checkboxes.
    Hope it helps.
    Regards, Dieter

  • Is it possible to create a button to take a screengrab on ipad?

    and what would the code be to do this?
    thanks!

    Not directly, but you can try the following.  You can use autoactivate to go to a different menu that has the "selected" picture in motion.  You have six pictures, so you have the original (all still menu), then 6 more, each with a different motion background in which the picture moves.  All buttons are able to be clicked in every menu.
    This works in a DVD, but not on a computer, unless the user uses a remote type function.  (Mouse over won't autoactivate.)

  • Is it possible to create a Functional module dynamically?

    Hello All,
    Does any one know whether is it possible to create a FM dynamically and write some code in it?
    Regards,
    Lisa.

    Hi,
    Yes it is possible.
    Use this FM to create a function module on the fly programatically.
    RS_FUNCTIONMODULE_INSERT.
    Here is an example
    Here an example how to call it:
    call function 'RS_FUNCTIONMODULE_INSERT'                                                   
      exporting                                                                               
    funcname                      = '/TEST40P/FB_TEST_EVE99'                               
        function_pool                 = 'CRAS1'                                                
    *   INTERFACE_GLOBAL              = ' '                                                    
    *   REMOTE_CALL                   = ' '                                                    
        short_text                    = 'TEST Anlage FB'                                       
       suppress_corr_check           = ' '                -----------------> means with transport popup                                                 
       update_task                   = '1'                                                     
    *   corrnum                       = 'B20K8A0V3F'                                           
       namespace                     = '/TEST40P/'                                             
    *   suppress_language_check       = 'X'                                                    
    *   AUTHORITY_CHECK               = 'X'                                                    
    *    save_active                   = ' '                                                   
        new_source                    = it_report[]                                            
    * IMPORTING                                                                               
    *   FUNCTION_INCLUDE              =                                                        
    *   CORRNUM_E                     =                                                        
    tables                                                                               
    import_parameter              = if_import                                               
       export_parameter              = if_export                                               
       tables_parameter              = if_tables                                               
       changing_parameter            = if_change                                               
       exception_list                = if_except                                               
       parameter_docu                = if_docu_tab                                             
    *   SOURCE                        =                                                        
    exceptions                                                                               
    double_task                   = 1                                                       
       error_message                 = 2                                                       
       function_already_exists       = 3                                                       
       invalid_function_pool         = 4                                                       
       invalid_name                  = 5                                                       
       too_many_functions            = 6                                                       
       no_modify_permission          = 7                                                       
       no_show_permission            = 8                                                       
       enqueue_system_failure        = 9                                                       
       canceled_in_corr              = 10                                                      
       others                        = 11.
    Regards,
    Sesh

  • Creating buttons dynamically in module pool screen

    Hi friends,
    I have one screen .
    It has two input fields .
    Say : Sales order no & Bin no .
    based on this i found some batches from database table using select query .
    Now the number of buttons depends on the no of batches i found .
    If I get 5 batches , then I will create 5 Push Buttons on screen .
    Please let me know , How to create these buttons dynamically on screen .
    Regards ,
    Manoj

    Hey ,
    I tried using custom container and then a toolbar in it .
    But this toolbar create buttons either vertically OR horizonatally .
    I want buttons all over the screen to be created dynmically .
    Please help ...

  • Can you create a button that adds specific text to a form field?

    Hi,
    I was wondering if it was possible to create a button in a PDF that, when clicked, adds specific text to a form field?
    I am trying to make a product catalogue where you click on a product button to add the product name or code to a form field.
    Each product in the catalogue will have a button and the more you click the more is added to the form field(s).
    Then when you have finished adding products to the form field(s) I want to be able to save and email the entire PDF as an order form.
    Any thoughts would be appreciated!
    Cheers,
    Jim

    Yes, it's possible. The most simple version of such a script will be something like this (used as the button's MouseUp event):
    var v = this.getField("Products");
    if (f.value!="")
         f.value += ", ";
    f.value += "Product1";

  • Create a Table Dynamically in WEB Dynpro Java with diferent type of column

    Hi everyone, I have a question if is possible to create a table dynamically in Web Dynpro Java?, depending of the RFC consults create the rows dynamically, ,this table must have diferent type of columns, for example link column (when the user click this link execute an action and show a adobe interactive form in another view), image column (show an image depending of the information)
    Thank you everyone
    Atte Israel

    Hello,Israel.
    Yes , it is possible through dynamic programming in wdModify of the View.
    You can do this ,for example, using cell variants.
    IWDTable tab = (IWDTable) view.getElement("TABLE_NAME");               
    IWDTableStandardCell cellV= (IWDTableStandardCell) view.createElement(IWDTableStandardCell.class,"TableStandardCell"+i); 
    cellV.setVariantKey("NotEditableVariant");
    cellV.setCellDesign((WDTableCellDesign)wdContext.nodeTableDaysTitle().currentTableDaysTitleElement().getAttributeValue("CellDesign"+i));
    IWDTextView textViewi= (IWDTextView) view.createElement(IWDTextView.class,"TextView"+i);  // -- here you control the type of the object that is displayed in the cell
    textViewi.bindText(dayAttrib);
    cellV.setEditor(textViewi);          
    tabColumn.addCellVariant(cellV);
    tab.addGroupedColumn(tabColumn,tab.numberOfGroupedColumns());     
    Using this code you can control even specific cells in the table and not only columns.
    Hope this helps you,
    Constantine

  • How to create a button to open directory

    Dear all,
    is it possible to create a button can open directory
    like My Documents
    i test this in CMD command prompte it's work but in
    in forms they are not work
    "explorer.exe" & @MyDocumentsDir
    or
    cmd /c "explorer.exe" & @MyDocumentsDir
    in forms :
    i create a button with trigger When-button-pressed
    in trigger :
    host('"explorer.exe" & @MyDocumentsDir');
    host ('cmd /c "explorer.exe" & @MyDocumentsDir'); ----> i think this should work
    but it's not work
    can you help please
    thanks
    regard

    hi Ammad
    sorry Ammad, but in the first step i get this errors
    Compilation errors on WEBUTIL_DB_LOCAL:
    PL/SQL ERROR 201 at line 9, column 12
    identifier 'WEBUTIL_DB.OPENBLOB' must be declared
    PL/SQL ERROR 0 at line 9, column 5
    Statement ignored
    PL/SQL ERROR 201 at line 18, column 12
    identifier 'WEBUTIL_DB.CLOSEBLOB' must be declared
    PL/SQL ERROR 0 at line 18, column 5
    Statement ignored
    PL/SQL ERROR 201 at line 24, column 5
    identifier 'WEBUTIL_DB.WRITEDATA' must be declared
    PL/SQL ERROR 0 at line 24, column 5
    Statement ignored
    PL/SQL ERROR 201 at line 29, column 12
    identifier 'WEBUTIL_DB.READDATA' must be declared
    PL/SQL ERROR 0 at line 29, column 5
    Statement ignored
    PL/SQL ERROR 201 at line 35, column 12
    identifier 'WEBUTIL_DB.GETLASTERROR' must be declared
    PL/SQL ERROR 0 at line 35, column 5
    Statement ignored
    PL/SQL ERROR 201 at line 40, column 12
    identifier 'WEBUTIL_DB.GETSOURCELENGTH' must be declared
    PL/SQL ERROR 0 at line 40, column 5
    Statement ignored
    PL/SQL ERROR 201 at line 45, column 12
    identifier 'WEBUTIL_DB.GETSOURCECHUNKS' must be declared
    PL/SQL ERROR 0 at line 45, column 5
    Statement ignored
    Failed to generate library.more help plz
    thanks

Maybe you are looking for

  • Windows no longer fit

    I have a macbook pro running 10.6.3 and whenever I open a program the image displayed within the program is zoomed in. It isn't the entire screen, so it's not a resolution issue, nor is it universal access or a ctrl+scroll issue. also tried command'/

  • Accessing container variable of BPM in Message Mapping function

    Hi, I have a scenario in BPM where i have a container variable that is used as a loop counter.I want to access that counter defined , every time when i go around the loop and perform certain actions based on that counter. so how can i access that var

  • Video adding problem.

    I've got a problem with my iTunes, i cant add video files. when i try it just won't add it, no error, no nothing. i converted it to mpeg4 but still the problem remains. help? thanks.

  • Function modules from the function pool Z_MEREP_G (Message no. MEREP_00530)

    We installed a new system and imported the syncbo definitions to this new system. After the import and generation of all T01 SyncBOs we get an error. E.g. for MAM25_016: Function modules from the function pool Z_MEREP_GEN_T01_MAM25_016 contain syntax

  • Text field required on PO

    Dear All, i want to have one new text field on item level in PO so that i can update some text for ma future requierment. in STD system i dunt have any field which covers my requirement. PLease guide Thanks