Basic typedef'd struct inclusion problem

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

  1. 99miles macrumors member

    Oct 10, 2008
    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?
  2. 99miles thread starter macrumors member

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

Share This Page