This isn't actually possible because you can't write a unicode text file. You can though write an NSString to a text file using a particular Unicode encoding. The most common encoding is UTF-8.
Check out writeToURL:atomically:encoding:error: in the NSString Class Reference. Possible encodings are listed under String Encodings in the Constants sections. For example, you write using UTF-8 by using NSUTF8StringEncoding.