I have Six labels, I want to hide two label’s text randomly when a button is clicked.I am new to iphone,How do I do that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
The easiest thing to do is to associate an int to each label using the
tagproperty. Then callviewWithTagand set thehiddenproperty toYES. You can generate a random int between1and6usingint i = (arc4random() % 6)+1;. To get two different ones, the easiest is just to do the same thing to definejuntiljandiare different.Now an example: