UIAlertSheet Help.

Discussion in 'iOS Development' started by Abcmsaj, Apr 22, 2008.

  1. Abcmsaj

    Abcmsaj Retired Moderator

    Joined:
    Jan 26, 2008
    Messages:
    5,501
    Likes Received:
    122
    Device:
    iPhone 6 Plus
    I want to create a UIAlertSheet for my app so that I can modify the Title from "Jiggy," but I have NO idea how to do it whatsoever...

    I've been here:
    http://jiggyapp.com/doc/files/UIKit/UIWindow-jsi.html#UIAlertSheet

    Found all the commands but dunno how to put them in an order.
    Can someone write me the basis of one alertsheet please?

    Title: About.
    Content: Created by Abcmsaj.
    Animated: Pop-Up.
    Button: Ok!

    An explanation would be cool too if you had time..

    Thanks,
    Abc.
  2. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    this should be in the jiggy dev section but here:

    i used to work with jiggy so:

    var alertSheet = new UIAlertSheet( "" , [ "Button1" , "Button2" , "Button3" ] , 0 );
    alertSheet.setTitle( "Title of alertsheet" );
    alertSheet.setBodyText( "Body of alertsheet" );
    alertSheet.setAlertSheetStyle = 0; // not sure thats completely correct try (0)
    alertSheet.onButtonClicked = function(button)
    {
    if (button == 1)
    {
    .............
    }
    if(button == 2)
    {
    .............
    }
    if (button ==3)
    {
    .............
    }
    };
    alertSheet.popupAlertAnimated( true );


    you may also choose to use "switch" statements which i feel are a lot cleaner.

    switch (button)

    case 1:
    // actions;
    break;

    case 2: and so on( never didi this with jiggy so sorry if incorrect...)





    hope this helps
  3. RazerM

    RazerM New Member

    Joined:
    Oct 4, 2007
    Messages:
    279
    Likes Received:
    5
    You can use else if to shorten a little bit

    Code:
    if (button==1){
    
    } else if (button==2){
    
    } else if (button==3){
    
    }
    switch..case statements need a break in each case
    Code:
    switch (button){
        case 1:
            //do stuff
            break;
        case 2:
            //do stuff
            break;
        case 3:
            //do stuff
            break;
    }

Share This Page