Re: Loco Cocoa Compiler
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.