Variable declarations within message body?
Variable declarations within message body?
- Subject: Variable declarations within message body?
- From: "Ila'n Terrell" <email@hidden>
- Date: Sun, 12 May 2002 05:10:19 -0700
I am working through the BNR Cocoa book by Aaron Hillegass. I have just
completed a "Challenge" and came across this question:
In this message:
[outputField setStringValue:[NSString stringWithFormat:@"%@ has %d
characters",[inputField stringValue], num]];
would it have been possible to declare and initialized the value that is
stored in num within the body of the message? so far, I have declared
and initialized num on it's own:
int num = [[inputField stringValue] length];
This syntax works fine, but I am always looking for ways to type less
code in....
Thanks in advance
-newbie
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.