Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

peacetrain67

macrumors member
Original poster
Dec 20, 2007
68
0
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.
 
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:
 

Attachments

  • Picture 11.png
    Picture 11.png
    27.2 KB · Views: 92
they are undeclared lol,
maybe there are not declared inside that scope? or you have created them correctly?
 
they are undeclared lol,
maybe there are not declared inside that scope? or you have created them correctly?

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.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.