xcode unknown type name

后端 未结 1 674
灰色年华
灰色年华 2020-12-08 00:31

I got code like this:

Match.h:

#import 
#import \"player.h\"

@interface Match : NSObject
{
    Player *firstPlayer;
}         


        
相关标签:
1条回答
  • 2020-12-08 01:01

    The normal way to solve this cycles is to forward declare classes:

    In Match.h:

    @class Player;
    @interface Match ...
        Player * firstPlayer;
    

    and do #import "Player.h only in Match.m, not in Match.h

    Same for the other two .h files.

    0 讨论(0)
提交回复
热议问题