Simplest 2 Questions Ever - Blanking Out

Discussion in 'iOS Programming' started by peacetrain67, Jul 22, 2009.

  1. peacetrain67 macrumors member

    Joined:
    Dec 20, 2007
    #1
    Hey, so in my application I have a UISegmentedControl (w/ 3 segments) representing my app's "Terms And Conditions." I would like to have an alertview appear the first time the "Log In" button is selected, and have it appear each time until one of the Alert buttons ("I Agree") is selected from it.
    Questions:
    A) I know I need to use NSUserDefaults, but I don't know how to do this for a specific button in an alertview.
    B) I would like the other buttons from the alert to send the user to the specific section of the Terms & Conditions. I have it set up so they each call the view with the Terms & Conditions and then call the specific segment, but my UIViews identified in the UISegmentedControl class are not declared in this class. How do I declare each of the three UIViews? - I know it's a simple question, but I am blanking out... And yes, I have imported the class. Thanks in advance for both/either of the answers.:D

    EDIT:I do know how to use an alertview, and I already have one in the app. I just don't know how to use NSUserDefaults to stop it's appearing after "I Agree" is click once, and I can't remember how to declare the views in other classes.
     
  2. peacetrain67 thread starter macrumors member

    Joined:
    Dec 20, 2007
    #2
    i may have worded this poorly: heres the errors im getting in the uialertview code.
    the 3 undeclared objects are uiviews identified in another class, btw.
    i just for some reason cant remember how to handle this and get the uiviews to respond in other classes:
     

    Attached Files:

  3. Kingbombs macrumors member

    Joined:
    Jun 24, 2009
    #3
    they are undeclared lol,
    maybe there are not declared inside that scope? or you have created them correctly?
     
  4. peacetrain67 thread starter macrumors member

    Joined:
    Dec 20, 2007
    #4
    dude, obviously they aren't declared. they are from a different class, but i want them to be used in that class. how do i declare them in that class? that was the question.
     
  5. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #5
    The short answer is make properties in the other class, #import the header for that other class, gain access to a pointer to an instance of the other class, and message the properties.

    Longer answer is don't do that. Having one class groping the views of another view controller is usually the sign of a bad design. Have a more general method on the second view controller that let's it do what it needs to do.
     

Share This Page