Objective c 如何保存UILabel';NSMutableArray中的属性?

Objective c 如何保存UILabel';NSMutableArray中的属性?,objective-c,iphone,ios7,Objective C,Iphone,Ios7,比如说, -(void)drawHypnoticMessage:(NSString *)message{ .... UILabel messageLabel = [[UILabel alloc]init]; messageLabel.backgroundColor = [UIColor clearColor]; messageLabel.textColor = [UIColor whiteColor]; messageLabel.text = message; [messageLabe

比如说,

-(void)drawHypnoticMessage:(NSString *)message{

....


UILabel messageLabel = [[UILabel alloc]init];

messageLabel.backgroundColor = [UIColor clearColor];
messageLabel.textColor = [UIColor whiteColor];
messageLabel.text = message;

[messageLabel sizeToFit];

int width = (int)(self.view.bounds.size.width - messageLabel.bounds.size.width);

int x = arc4random() % width;

int height = (int)(self.view.bounds.size.height - messageLabel.bounds.size.height);

int y = arc4random() % height;

CGRect frame = messageLabel.frame;
frame.origin = CGPointMake(x,y);
messageLabel.frame = frame;

[self.view addSubview:messageLabel];

...}
我希望能够将此标签“messageLabel”添加到NSMutable数组中,如下所示:

NSMutableArray *thisArray;

[thisArray addObject:messageLabel];
UILabel *thisLabel = [thisArray objectAtIndex:0];
[self.view addSubview: thisLabel];
然后在状态恢复后访问它,如下所示:

NSMutableArray *thisArray;

[thisArray addObject:messageLabel];
UILabel *thisLabel = [thisArray objectAtIndex:0];
[self.view addSubview: thisLabel];
出于某种原因,当我尝试访问存储在NSMutableArray中的UILabel时,-->thisLabel.text thisLabel thisLabel.textColorthisLabel.frame中的文本 我希望能够将此标签“messageLabel”添加到NSMutable 像这样的数组:

NSMutableArray *thisArray;

[thisArray addObject:messageLabel];
UILabel *thisLabel = [thisArray objectAtIndex:0];
[self.view addSubview: thisLabel];
NSMutableArray*此数组

[thisArray addObject:messageLabel];
你记得第一句话吗
重新分配NSMutableArray-是否发生过这种情况?