ios - UILabel 中的文本不会添加到单独的 View Controller 数组中

标签 ios objective-c uialertview

我有一个 NSMutableArray,我想在子类 UIAlertView 中添加输入到 UILabel 的值,这允许我添加 subview 。问题是我必须跟踪分数的 UIViewController 没有收到输入的值,因为它不断返回 Nil 值。

UIAlertVIew Controller 中,我使用 NSNotificationCenter 发布通知。保存分数的 UIViewController 有一个检查更新的监听器。

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

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

}

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

最佳答案

您需要分配/初始化 CustomUiAlertView。

关于ios - UILabel 中的文本不会添加到单独的 View Controller 数组中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25281296/

相关文章:

ios - Azure Devops Pipeline MacOS VM 镜像似乎没有任何 iOS 模拟器

objective-c - glUseProgram 在 iOS 中不起作用

ios - 尝试执行 UIAlert 或 PerformSegueWithIdentifier 时,以 NSException 类型的未捕获异常终止

ios - 我如何通知用户远程 API 由于连接问题而失败?

ios - 我可以在 ios sdk 的警报 View 中添加单选按钮吗?

ios - Swift 中的开关 - 开关中的 Case 标签应该至少有一个可执行语句

iPhone 4,录音后的音频电平问题

ios - AlamofireObjectMapper 在应该给我值(value)的时候得到了 nil

ios - 如何防止用户同时从图片库中选择和交换图片,以免进入编辑 View ?

iphone - 支持不同大小单元格的 iOS GridView