Re: Set string value

2008-07-09 Thread Kevin Walzer
Sherm Pendley wrote: On Wed, Jul 9, 2008 at 4:12 PM, Kevin Walzer <[EMAIL PROTECTED]> wrote: Hello, I'm trying to work through an exercise in the new Hillegass book and am encountering difficulties. The app fails to build. The relevant code snippet is below, with errors noted in the comments:

Re: Set string value

2008-07-09 Thread Ken Thomases
In addition to what Alex said... On Jul 9, 2008, at 3:12 PM, Kevin Walzer wrote: -(IBAction)getCount:(id)sender { NSString *string = [textField stringValue]; int *stringLength = [string length]; //warning: initialization makes pointer from integer without a cast This decl

Re: Set string value

2008-07-09 Thread Sherm Pendley
On Wed, Jul 9, 2008 at 4:12 PM, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Hello, > > I'm trying to work through an exercise in the new Hillegass book and am > encountering difficulties. The app fails to build. The relevant code snippet > is below, with errors noted in the comments: > > -(IBAction)g

RE: Set string value

2008-07-09 Thread Abernathy, Joshua
Behalf Of Alex Wait Sent: Wednesday, July 09, 2008 4:15 PM To: [EMAIL PROTECTED] Cc: Cocoa-dev@lists.apple.com Subject: Re: Set string value It's this line [textLabel setStringValue:@"\"[EMAIL PROTECTED]" is %d characters long", string, stringLength]; The setStringVal

Re: Set string value

2008-07-09 Thread Vitaly Ovchinnikov
try this: NSString *string = [textField stringValue]; int stringLength = [string length]; NSString *msg = [NSString stringWithFormat:@"\"[EMAIL PROTECTED]" is %d characters long", string, stringLength] [textLabel setStringValue:msg]; NSLog(@"%@", string); On Thu, Jul 10, 2008 at 12:12 AM, Kevin

Re: Set string value

2008-07-09 Thread I. Savant
>int *stringLength = [string length]; //warning: initialization makes > pointer from integer without a cast You're declaring an int pointer (int *) instead of an int (int), then assigning it an int value (the result of asking 'string' for its -length). -- I.S. _

Re: Set string value

2008-07-09 Thread Alex Wait
It's this line [textLabel setStringValue:@"\"[EMAIL PROTECTED]" is %d characters long", string, stringLength]; The setStringValue function does not take more than one argument. If you want to format the string like that try [textlabel setStringValue: [NSString stringWithFormat:@"\"[EMAIL PROTECT

Set string value

2008-07-09 Thread Kevin Walzer
Hello, I'm trying to work through an exercise in the new Hillegass book and am encountering difficulties. The app fails to build. The relevant code snippet is below, with errors noted in the comments: -(IBAction)getCount:(id)sender { NSString *string = [textField stringValue]