NSMutableString *str, *str1;
//allocation here
i am using
[str appendString:str1]
is not working.
[str appendFormat:str
Although in Swift it is not the general practice to use NSMutableString, it may at times be necessary. This is how you would do it:
var str: NSMutableString = NSMutableString()
var str1: NSMutableString = "some value"
str.appendString(str1 as String) // str = "some value"
Note that the usual way to append a string in Swift is like this:
var str = ""
let str1 = "some value"
str += str1
where str
and str1
are inferred to be of type String
.