Re: Nested messages and void error
Re: Nested messages and void error
- Subject: Re: Nested messages and void error
- From: Jim Correia <email@hidden>
- Date: Sun, 12 Aug 2001 23:20:03 -0400
On Sunday, August 12, 2001, at 10:37 PM, email@hidden wrote:
This line of code causes "void messages not dealt with..." (or the
like):
aStr = [[NSMutableString stringWithString: [aString string]]
appendString:
@"another string"]; //shew!
Is nesting like this not allowed?
The exact message is "void value not ignored as it ought to be" and the
wording is the key to your problem.
It has nothing to do with the nesting, but the fact that appendString
returns void (nothing) and you are trying to assign it.
aStr = [[NSMutableString stringWithString: [aString string]];
[aStr appendString: @"another string"];
Is how it must be done so you can keep a pointer to the created string.