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:
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
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
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
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
>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.
_
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
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]