Lottery.m error with nested functions


#1

I am getting this error in my lottery.m code:

/Users/user/Dropbox/dev/cocoa_programming_for_os_x/lottery/LotteryEntry.m:43: error: nested functions are disabled, use -fnested-functions to re-enable

I am running XCode 3.2.5 on OS 10.6.7

Here is my full lottery.m code: pastebin.com/RWbx9kXR

I am also getting these two errors but I asume they may be related to the first:

/Users/user/Dropbox/dev/cocoa_programming_for_os_x/lottery/LotteryEntry.m:43: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘result’
/Users/user/Dropbox/dev/cocoa_programming_for_os_x/lottery/LotteryEntry.m:43: error: ‘result’ undeclared (first use in this function)

Thanks
ian


#2

You appear to be missing a semicolon on line 42, after NSString *result. The first error message was entirely unhelpful here, it was the latter two that tipped me off.

~Mikey


#3

Wow… How slow am I.

Works perfect! Thanks.


#4

No worries. Happens to the most experienced of devs.