• 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: Loco Cocoa Compiler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loco Cocoa Compiler


  • Subject: Re: Loco Cocoa Compiler
  • From: j o a r <email@hidden>
  • Date: Sun, 2 May 2004 21:33:40 +0200

If you declare variables in a switch, you need to add a new block using
curly braces:

switch (something)
{
case 1 :
[someObj someMethod]; // This is fine as it is
case 2 :
{ // Here you need a set of curlies
NSString *someString = @"";
NSLog(someString);
}
}

On 2004-05-02, at 20.40, Adam wrote:

> I have a block of code:
>
> case NSStreamEventHasBytesAvailable:
> NSLog(@"NSStreamEventHasBytesAvailable"); //Line 1
> NSString *newLineChar = @"\n"; //Line 2
> NSString *carriageReturnChar = @"\r"; //Line 3
>
> If I run this code it works fine. If I remove line 1 (which was only
> being used for debugging purposes) I get an error
>
> "parse error before '*' token - on line 2
>
> This makes no sense to me. These tow lines should not be effecting
> each other.

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.


References: 
 >Loco Cocoa Compiler (From: Adam <email@hidden>)

  • Prev by Date: Re: Class generator script
  • Next by Date: Re: NSDraggingInfo question
  • Previous by thread: Re: Loco Cocoa Compiler
  • Next by thread: Class generator script
  • Index(es):
    • Date
    • Thread