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

你可能感兴趣的:(Objc to Swift:[NSString stringWithFormat:])