Ok my problem:
I have function to create a Label:
- (void)crateBall:(NSInteger *)nummer {
UILabel *BallNummer = [[UILabel alloc] initWithFrame:CGRectMake(50, 100, 200, 100)];
BallNummer.text = [NSString stringWithFormat:@"%i", nummer];
[self.view addSubview:BallNummer];
}
Now i wanna access the label in a other function to change text, frame ect.
The number of these labels is dynamic so i don’t wanna declare each one in the .h file.
(i dont mean the number .text = 123 i mean the number of labels in the view)
All UIView subclasses have integer
tagproperty for your purposeLater you can get this label using
-viewWithTag:function:P.S. as you pass pointer to int to your function (do you really need to do so?) you should dereference it before using its value:
P.P.S. Do not forget to release label your create (I’ve added release to my code) – your code leaks memory