如何使用空值重置NSMutableString?

use*_*795 17 iphone objective-c

NSMutableString *str = [[NSMutableString alloc] init];
Run Code Online (Sandbox Code Playgroud)

假设str有权知道值"我".

然后单击一个按钮,我希望str的值重置.这是字符串值变为零或空.

现在我正在使用它,[myword stringWithString: @""];但没有工作.

tas*_*oor 31

使用带有""的setString作为参数.

[myWord setString:@""];

如果你想让它为零,那么释放它然后将其设置为零.

[myWord release];
myWord = nil;