• 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: Cannot declare variables in the middle anymore
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cannot declare variables in the middle anymore


  • Subject: Re: Cannot declare variables in the middle anymore
  • From: Oscar Morales Vivó <email@hidden>
  • Date: Tue, 8 Jul 2003 16:00:09 +0200

I'm not sure, but I'd guess you had some C99-like options on by default, and they have been turned off when you updated (so it's trying to do 'pure' pre-C99 C). Check your options, and activate any that say something about C99, that should get it working again.

On Tuesday, July 8, 2003, at 15:10PM, Lorenzo wrote:

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.



/*
Oscar Morales Vivs

Eternal Computer Science Student. Master of C++ Templates. Cocoa Nut. Computer Graphics Scientiam Lumina. UI Guru in Training. Dabbler in all things CS and most which are not.

Web stuff: http://homepage.mac.com/oscarmv/index.html
*/
_______________________________________________
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: 
 >Re: Cannot declare variables in the middle anymore (From: Lorenzo <email@hidden>)

  • Prev by Date: Re: non-blocking file writes
  • Next by Date: Re: NSString to int (or double) conversion
  • Previous by thread: Re: Cannot declare variables in the middle anymore
  • Next by thread: Re: Cannot declare variables in the middle anymore
  • Index(es):
    • Date
    • Thread