How would I go about making a reference to a UILabel inside a variable?
For example;
NSObject *instance;
switch (option) {
case 0:
{
NSObject *instance = self.player1;
}
case 1:
{
NSObject *instance = self.player2;
}
}
instance.text = @"Hello"
I then want to change the text of the label that is in NSObject, but that doesn’t appear to work.
So how would I go about doing this?
By the way, I’m new to Objective C, if you can’t tell.
I highly suggest going through some Objective-C and/or C tutorials — if you are having problems with the basics of the syntax, you will find it hard to make much progress. Stack Overflow isn’t the best way to learn that kind of thing.