Re: Cannot declare variables in the middle anymore
Re: Cannot declare variables in the middle anymore
- Subject: Re: Cannot declare variables in the middle anymore
- From: Lorenzo <email@hidden>
- Date: Tue, 08 Jul 2003 15:10:11 +0200
Amazing!!!
I have been developing software on Cocoa since 2001.... and I was always
able to declare variables in the middle of the methods. I have thousands of
lines of code with variables declared in the middle of the method. For sure!
And it worked very well.
And even if I upgraded from OS X 10 throught 10.2.6 and from the first to
the last version of Developer Tools, I was able to do that all the time.
What should I think? Maybe I have to mark some check-box?
Maybe in my machine something has been corrupted?
Only now, after I tried one only time to launch XCode and compile a short
application, I got that error message, then I closed XCode and stuffed it.
Now I am using Project Builder 2.1 and again I get that error message.
What should I do now? Should I fix thousands of lines of code?
HELP! :-O
Best Regards
--
Lorenzo
email: email@hidden
>
From: Robert Tillyard <email@hidden>
>
Date: Tue, 08 Jul 2003 13:50:02 +0100
>
To: Lorenzo <email@hidden>
>
Subject: Re: Cannot declare variables on the fly anymore
>
>
I've only got PB 2.1 (Dec 2002) and I've never been able to do that,
>
gcc has always given me an error and I thought that I has read in one
>
of the Cocoa books that Objective-C doesn't allow that.
>
>
Regards, Rob.
>
>
On Tuesday, July 8, 2003, at 01:27 pm, Lorenzo wrote:
>
>
> Hi,
>
> Since I tried once only XCode, now using again Project Builder 2.1,
>
> when I declare a variable in the middle of the method like "destName"
>
> here
>
> below
>
>
>
> ...
>
> exist = [manager fileExistsAtPath:myPath isDirectory:&isDir];
>
> NSString *destName = [newPath
>
> stringByAppendingPathComponent:kFolder];
>
>
>
> the compiler tells me: MYClass.m:436: parse error before `*'
>
> meaning before "*destName"
>
>
>
> To avoid the error message I have to declare the variables at the
>
> begin of
>
> the method, and this means a ton of work...
>
> I have to do
>
>
>
> - (void)myMethod
>
> {
>
> BOOL exist ;
>
> NSString *destName;
>
>
>
> exist = [manager fileExistsAtPath:myPath isDirectory:&isDir];
>
> destName = [newPath stringByAppendingPathComponent:kFolder];
>
> ...
>
>
>
>
>
> What did happen to the compiler?
>
> How could I fix this? Help!
>
>
>
>
>
> Best Regards
>
> --
>
> Lorenzo
>
> email: email@hidden
_______________________________________________
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.