Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何将当前选中的字符串分配给detailLabel UITableViewCell?_Ios_Swift - Fatal编程技术网

Ios 如何将当前选中的字符串分配给detailLabel UITableViewCell?

Ios 如何将当前选中的字符串分配给detailLabel UITableViewCell?,ios,swift,Ios,Swift,Swift编译错误“text”不可用:在iOS 7及更早版本中不推荐使用的API在Swift中不可用 编辑: @IBVAR弱var详细标签:UILabel 但是, 我遇到过这样的情况,我如何修复这些行来证明所有iOS版本?detailLabel是UILabel吗?Style:Right Detail,UITableViewCell当我将其修复为UILabel时,但现在我的编译终止了,如:libc++abi.dylib:以NSException LLDb类型的未捕获异常终止我不明白的是,在可以访问

Swift编译错误“text”不可用:在iOS 7及更早版本中不推荐使用的API在Swift中不可用

编辑: @IBVAR弱var详细标签:UILabel

但是,


我遇到过这样的情况,我如何修复这些行来证明所有iOS版本?

detailLabel是UILabel吗?Style:Right Detail,UITableViewCell当我将其修复为UILabel时,但现在我的编译终止了,如:libc++abi.dylib:以NSException LLDb类型的未捕获异常终止我不明白的是,在可以访问单元格本身的方法之外,您如何访问单元格的正确细节?每个单元格的detailLabel将具有不同的值。或者你使用的是静态单元格?表视图内容:静态单元格,我使用的是正确的细节和推送segue动态原型来选择游戏。当用户返回静态页面detailLabel:UILabel时,需要由用户选项更新。我已经修复了它,但现在编译终止了,因为我在上面的主题编辑中提到了它。>以NSException lldb类型的未捕获异常终止
override func viewDidLoad() {
  super.viewDidLoad()
  **detailLabel.text = game**
}

@IBAction func selectedGame(segue:UIStoryboardSegue) {
  if let gamePickerViewController = segue.sourceViewController as? GamePickerViewController,
    selectedGame = gamePickerViewController.selectedGame {
    **detailLabel.text = selectedGame**
    game = selectedGame
  }
}
init PlayerDetailsViewController
2015-09-01 14:14:45.050 Ratings[3594:145699] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Ratings.PlayerDetailsViewController 0x7ff6c3d42e80> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key detailLabelCurrent.'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010483dc65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x00000001063a8bb7 objc_exception_throw + 45
    2   CoreFoundation                      0x000000010483d8a9 -[NSException raise] + 9
    3   Foundation                          0x0000000104c5bb53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
    4   CoreFoundation                      0x0000000104785d50 -[NSArray makeObjectsPerformSelector:] + 224
    5   UIKit                               0x00000001053b44eb -[UINib instantiateWithOwner:options:] + 1506
    6   UIKit                               0x000000010520c6d8 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
    7   UIKit                               0x000000010520ccc8 -[UIViewController loadView] + 109
    8   UIKit                               0x00000001053d0db8 -[UITableViewController loadView] + 76
    9   UIKit                               0x000000010520cf39 -[UIViewController loadViewIfRequired] + 75
    10  UIKit                               0x000000010520d3ce -[UIViewController view] + 27
    11  UIKit                               0x0000000105246d3b -[UINavigationController preferredContentSize] + 149
    12  UIKit                               0x00000001051eceee -[UIPresentationController preferredContentSizeDidChangeForChildContentContainer:] + 101
    13  UIKit                               0x00000001051ea33d __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 122
    14  UIKit                               0x00000001051005ec _applyBlockToCFArrayCopiedToStack + 314
    15  UIKit                               0x0000000105100466 _afterCACommitHandler + 533
    16  CoreFoundation                      0x0000000104770ca7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    17  CoreFoundation                      0x0000000104770c00 __CFRunLoopDoObservers + 368
    18  CoreFoundation                      0x0000000104766a33 __CFRunLoopRun + 1123
    19  CoreFoundation                      0x0000000104766366 CFRunLoopRunSpecific + 470
    20  GraphicsServices                    0x0000000108811a3e GSEventRunModal + 161
    21  UIKit                               0x00000001050dc8c0 UIApplicationMain + 1282
    22  Ratings                             0x000000010461b357 main + 135
    23  libdyld.dylib                       0x0000000106ade145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)