tags:

views:

24

answers:

1

I have this code that changes the text of an NSTextField

[TextField setStringValue: [PrinterCard print]];

(PrinterCard print returns an NSString) What I want to do now is I want to append the PrinterCard print string to the text of TextField. I also want to do this on the next line, so I want basically to append this:

@"\n%@", [PrinterCard Print]

How is this done?

A: 

use

[NSString stringWithFormat:@"\n%@",[PrinterCard Print]]
Gyani
I know how to do that, the important part was how do I add text on to the end of the already existing text that is in the TextField. I was thinking something like [TextField appendStringValue:[PrinterCard Print]];
Regan
for appending string you can use string1 = [string1 stringByAppendingString:string2];
Gyani