Calling voids. Why do I get this warning?

Discussion in 'iOS Programming' started by alexandergre, Aug 29, 2009.

  1. alexandergre macrumors member

    alexandergre

    Joined:
    Jul 28, 2009
    #1
    It works fine. but I get this warning:
    .h
    Code:
    static void *reset;
    .m
    Code:
    -(IBAction)ResetButton:(id)sender{
    [self reset];
    }
    
    
    -(void)reset{
    NSLOG(@"Resetting");
    }
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    This would be correct:

    .h
    Code:
    -(void)reset;
    The compiler is ignoring what you have in the header.

    What you have in the header is a declaration of a static variable of type void* named reset.

    static in a header is almost always wrong.
     
  3. wlh99 macrumors 6502

    Joined:
    Feb 7, 2008
  4. alexandergre thread starter macrumors member

    alexandergre

    Joined:
    Jul 28, 2009

Share This Page