Appending to the end of a file with NSMutableString

I guess you could do a couple of things: NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:aPath]; [fileHandle seekToEndOfFile]; [fileHandle writeData:[textToWrite dataUsingEncoding:NSUTF8StringEncoding]]; [fileHandle closeFile]; Note that this will append NSData to your file — NOT an NSString. Note that if you use NSFileHandle, you must make sure that the file exists before hand. fileHandleForWritingAtPath will return nil if … Read more

Objective C: convert a NSMutableString in NSString

Either via: NSString *immutableString = [NSString stringWithString:yourMutableString]; or via: NSString *immutableString = [[yourMutableString copy] autorelease]; //Note that calling [foo copy] on a mutable object of which there exists an immutable variant //such as NSMutableString, NSMutableArray, NSMutableDictionary from the Foundation framework //is expected to return an immutable copy. For a mutable copy call [foo mutableCopy] instead. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)