I am trying to follow the stanford itunes classes.
As i am watching the lectures, ( which are from this year), they are using examples with nested functions.
However everytime i try to do a simple nested function i get an error that says to use -fnested -function to enable them.
such as this is good
instead of allowing this
In this case its such a small amount of code to write i don't really care, however its annoying.
My question is really, why are they disabled in the first place. what problem does nesting your functions cause that Apple recommends that they stay off.
and i have searched the forum and looked to turn them on but i cant seem to find the "other c flags" in xcode to do that. i have gone to the target build menu but i dont see that flag area to put the code in. i am using xcode 3.1.2
any thoughts anyone?
Greg
As i am watching the lectures, ( which are from this year), they are using examples with nested functions.
However everytime i try to do a simple nested function i get an error that says to use -fnested -function to enable them.
such as this is good
Code:
- (IBAction)increaseNumOfSides
{
NSLog(@"im in the increase action");
int n = myPoly.numberOfSides;
++n;
[myPoly setNumberOfSides: n];
[self updateInterface];
}
Code:
- (IBAction)increaseNumOfSides
{
NSLog(@"im in the increase action");
int n += myPoly.numberOfSides; // this is not allowed
[myPoly setNumberOfSides: n];
[self updateInterface];
}
My question is really, why are they disabled in the first place. what problem does nesting your functions cause that Apple recommends that they stay off.
and i have searched the forum and looked to turn them on but i cant seem to find the "other c flags" in xcode to do that. i have gone to the target build menu but i dont see that flag area to put the code in. i am using xcode 3.1.2
any thoughts anyone?
Greg