I am working on a simple text editor in Cocoa / Objective-C for a practice project, and I ran into an error that I would never have expected.
I have an NSString for my file contents as well as an NSString for this path. When I try to write the contents to a file, I use the following method:
[FileContents writeToFile: CurrentFileName atomically: NO encoding: NSStringEncoding error: nil];
I have used this method many times without errors, but today I get an error message:
"Expected expression before 'NSStringEncoding'"
If anyone can help me with this, we will be very grateful. I canβt understand what might cause the error. Many thanks!
source share