来自UILabel的文本未添加到单独的视图控制器阵列中

时间:2014-08-13 08:19:22

标签: ios objective-c uialertview

我有一个NSMutableArray,我希望将一个输入的值添加到子类UILabel中的UIAlertView中,以便我添加子视图。问题是,我必须跟踪得分的UIViewController没有收到输入的值,因为它不断返回Nil值。

UIAlertVIew控制器中,我使用NSNotificationCenter发布通知。保存分数的UIViewController具有检查更新的侦听器。

以下是IViewController听到通知时调用的方法的代码

-(void)doneButtonPressed{
    i++;
    // g2RowIndex ++;
    j = i -2;
    k = i-3;
    CustomUiAlertView *customAlertView;
    NSLog(@"%@", customAlertView.p1G1ScoreLabel.text);

}

scoreLabel属于子类UIViewController。我想知道如何将UILabel中的输入值放在socreViewController中的scoreArray中。

1 个答案:

答案 0 :(得分:1)

您需要分配/初始化CustomUiAlertView。