Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset a NSMutableString with a empty value?

NSMutableString *str = [[NSMutableString alloc] init];

Suppose str has right know a value "me".

And On click of a button I want that the value of str get reset. That is the string value become nil or empty.

now i am using this [myword stringWithString: @""]; but not working.

like image 692
user426795 Avatar asked Aug 23 '10 09:08

user426795


1 Answers

Use setString with "" as parameter.

[myWord setString:@""];

And if you want to make it nil, then release it and then set it to nil.

[myWord release];
myWord = nil;
like image 160
taskinoor Avatar answered Oct 07 '22 01:10

taskinoor