Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个有 2 列的 NSTableView。我确实有代码可以在每行的单元格中输入文本。有没有办法限制单元格中输入的字符数最多为 10?
您不能告诉单元格自己剪切 NSString。但是你可以剪切 inputString
cell.textLabel.text = [yourString substringToIndex:10];