I want to use two labels on the same view in an iPod Touch application. I have created the two la开发者_JAVA技巧bels, but I only know how to access on of them. Does any one have an example of how to do this?
UILabel *label1 = [[UILabel alloc] initwithFrame: CGRectMake(0,0,100,100)];
UILabel *label2 = [[UILabel alloc] initwithFrame: CGRectMake(0,0,200,200)];
label1.text = @"Label One";
label2.text = @"Label Two";
Or, if you created your labels in Interface builder, make sure you've got IBOutlet
s for both of them in order to access them from your code.
精彩评论