Basic typedef'd struct inclusion problem

Discussion in 'iOS Programming' started by 99miles, Feb 25, 2009.

  1. macrumors member

    Joined:
    Oct 10, 2008
    #1
    I have a typedef'd struct I want to use in multiple files:

    typedef struct point {
    int col;
    int row;
    } point;

    When I include it in a header file that is included by multiple files, I get:
    "SomeFile.h:18: fatal error: method definition not in @implementation context" where another .h file defines a method with that type:
    -(CGRect)createObj: (point)p;

    What am I doing wrong?
    Thanks!
     
  2. thread starter macrumors member

    Joined:
    Oct 10, 2008
    #2
    Oops, I got it. I was including the class file, not the header of the file that defined the struct.
     

Share This Page