1
저는 iPhone 앱 프로그래밍에 관한 iTunes U 코스를 진행하고 있으며, 지금까지 편지에 대한 지침을 따라 왔습니다. 이것은 단순한 카드 매칭 게임이지만, XCode는 계속해서 카드 클래스를 완전히 구현하지 못하고 있음을 계속 알려줍니다.Xcode가 "불완전한 구현"경고를주는 이유는 무엇입니까?
Card.h
//
// Card.h
// Matchismo
//
// Created by Jacob Peroutek on 6/14/13.
// Copyright (c) 2013 JPeroutek. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Card : NSObject
@property (strong, nonatomic) NSString *contents;
@property (nonatomic, getter=faceUp) BOOL faceUp;
@property (nonatomic, getter=isUnplayable) BOOL unplayable;
- (int) match:(NSArray *)otherCards;
@end
는이 내 Card.m입니다. 그것은 옆에 작은 노란색 삼각형 경고 기호를 표시하고 "불완전 구현"라고
Card.m
//
// Card.m
// Matchismo
//
// Created by Jacob Peroutek on 6/14/13.
// Copyright (c) 2013 JPeroutek. All rights reserved.
//
#import "Card.h"
@implementation Card
- (int)match:(NSArray *)otherCards
{
int score = 0;
for (Card *card in otherCards)
{
if([card.contents isEqualToString:self.contents])
{
score = 1;
}
}
return score;
}
@end
이이 사이트에 내 첫 번째 질문은, 그래서 내가 뭔가 잘못을 한 경우에, 저에게 알려주십시오.
편집
: 본인은 @implementation 후 내 Card.m에@synthesize contents;
@synthesize faceUp;
@synthesize unplayable;
에 입력하고, 여전히 나에게 같은 경고를 제공합니다.
Xcode 버전 및 타겟에 따라 속성에'@ synthesize'를 사용해야 할 수도 있습니다. – gaige
은 xcode 버전입니까? –
내 버전은 4.6.3입니다. – JPeroutek