Doubt in goto statement

Discussion in 'iOS Programming' started by iphonejudy, Mar 22, 2009.

  1. iphonejudy macrumors 6502


    Sep 12, 2008
    I used goto statement as below



    Go to News;

    But i got errors("News label used but not defined")
  2. Jeremy1026 macrumors 68020


    Nov 3, 2007
    Judging by the code you posted...actually, its impossible to know what's wrong from what you had.
  3. admanimal macrumors 68040

    Apr 22, 2005
    As far as I know, the appropriate syntax for a goto statement is "goto News;" not "Go to News;". Do you reallllly want to use a goto statement though? Chances are there is a much less archaic way to do whatever you are trying to do.
  4. mccannmarc macrumors 6502


    Aug 15, 2008
    Manchester, UK
    Why on earth are you using goto in such a simple piece of code? Using goto is considered bad programming practice in C/C++/Objective-C (in fact most languages besides archaic languages and assembler) these days and can easily be avoided with the use of functions
  5. kalimba macrumors regular

    Jun 10, 2008
    I think the error is the compiler's way of saying "Please, for goodness' sake, do not use the goto statement!" :D

Share This Page