【问题标题】:Displaying array values in a textfield在文本字段中显示数组值
【发布时间】:2017-11-14 18:54:56
【问题描述】:

我在另一个数组下有一个数组,我想要内部数组的值并在 iOS swift 的 UITextfield 中显示它们(例如:xyz、ABC、123)

let memberDetail = tobeReceivedArray[indexPath.row]["groupMembersVO"] 
self.memberArray = memberDetail as! [AnyObject] 
let amount = (tobeReceivedArray[indexPath.row]["totalPay"] as! Int) as NSNumber 
let date = tobeReceivedArray[indexPath.row]["uploadOn"] as! String 
let name = memberArray[indexPath.row]["name"] as! String 
cell.amountLable.text = amount.stringValue cell.timeLable.text = date 
cell.nameLable.text = name 

【问题讨论】:

  • 到目前为止你尝试过什么?也许我们可以看看它并告诉你为什么它不起作用。
  • 目前你得到了什么?
  • 我确实在数组中获取值.. 我想在文本字段中解析这些值,例如 name = xyz,abc,123
  • 让 memberDetail = tobeReceivedArray[indexPath.row]["groupMembersVO"] self.memberArray = memberDetail as! [AnyObject] let amount = (tobeReceivedArray[indexPath.row]["totalPay"] as!Int) as NSNumber let date = tobeReceivedArray[indexPath.row]["uploadOn"] as! String let name = memberArray[indexPath.row]["name"] as!字符串 cell.amountLable.text = amount.stringValue cell.timeLable.text = 日期 cell.nameLable.text = name
  • 欢迎来到 stackoverflow.com。请花点时间阅读the help pages,尤其是名为“What topics can I ask about here?”和“What types of questions should I avoid asking?”的部分。也请take the tour 阅读how to ask good questions。最后请学习如何创建Minimal, Complete, and Verifiable Example

标签: ios swift


【解决方案1】:

您可以简单地使用平面地图来更好地理解,您可以点击此链接: http://sketchytech.blogspot.in/2015/06/swift-what-do-map-and-flatmap-really-do.html

【讨论】:

    猜你喜欢
    • 2014-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多