help with simple problem

It is actually a challenge from one of the books on Cocoa.

When the user types in a string and clicks the button, the message text should display the input string and the number of characters it has.

So far I have done this. The result is not displayed in the exact format as seen in the image. I need help with that. (I only see the number in the result. )

#import <Cocoa/Cocoa.h>
@interface CountString : NSObject {
IBOutlet NSTextField *textField;
IBOutlet NSTextField *textField2;


  • (IBAction) countIt:(id)sender;

#import “CountString.h”
@implementation CountString

  • (IBAction) countIt: (id) sender
    NSString *string = [textField stringValue];

    [textField2 setIntValue:[string length]];

You have to format the string. Currently, you are only setting the text field to the value of the string’s length.

thanks, Craig.