• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Nested messages and void error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Nested messages and void error
      • From: Charles Jolley <email@hidden>
References: 
 >Nested messages and void error (From: email@hidden)

  • Prev by Date: Nested messages and void error
  • Next by Date: Re: Some help would be greatly appreciated
  • Previous by thread: Nested messages and void error
  • Next by thread: Re: Nested messages and void error
  • Index(es):
    • Date
    • Thread