私は客観的なcを学ぼうとしています。'struct myStruct *'から 'struct myStruct *'に代入される互換性のないポインタ型
これはすべて私の.mファイル
@interface TetrisEngine()
@property (nonatomic, readwrite) struct TetrisPiece *currPiece;
@end
struct TetrisPiece {
int name;
struct {
int colOff, rowOff;
} offsets[TetrisPieceRotations][TetrisPieceBlocks];
};
この隣の男の内容が適切でないはずです。私は、戻り値はあなたが
static struct TetrisPiece pieces[TetrisNumPieces] = {...};
@implementation TetrisEngine
@synthesize currPiece;
- (void) nextPiece
currPiece = &pieces[ ((random() % (TetrisNumPieces * 113)) + 3) % TetrisNumPieces];
を手助けするために見る必要があるすべてであると仮定し、私はエラーを取得する場所です:互換性のないポインタ型は、「構造体TetrisPiece *」
から「構造体TetrisPiece *」に割り当てます
言語でOO機能がある場合は、ここでstructsを使用する理由は何ですか? –