Objc to Swift:[NSString stringWithFormat:]

Objective-C

NSTextField * textField;
textField.stringValue = [NSString stringWithFormat: @"%ld", 100];

Swift

let textField: NSTextField!
textField.stringValue = NSString( format: "%ld", 100 ) as String
    原文作者:YH简简单单的生活
    原文地址: https://www.jianshu.com/p/71ca8b9424b3
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞