xcode编译的时候 出现Thread 1: signal SIGABRT

谁帮我看一下链接:http://pan.baidu.com/s/1qYmrMvM密码:ffji... 谁帮我看一下 链接:http://pan.baidu.com/s/1qYmrMvM 密码:ffji 展开
 我来答
xiangjuan314
2016-05-04 · TA获得超过3.3万个赞
知道大有可为答主
回答量:2.9万
采纳率:0%
帮助的人:2898万
展开全部
修改了一下 GameViewController.m , 这样运行就可以了,没有细看,你可以自己分析一下:
@implementation GameViewController

//- (CardMatchingGame *) game
//{
// if (!_game) _game = [[CardMatchingGame alloc] initWithCardCount:[self.cardButtons count] usingPokemonCard:[self createPokemonCard]];
// return _game;
//}

- (PokemonCard *)createPokemonCard
{
return [[PlayingPokemonCard alloc] init];
}

- (IBAction)touchCardButton:(UIButton *)sender
{
int cardIndex = [self.cardButtons indexOfObject:sender];
_selectedCardIndex = cardIndex;
NSLog(@"touched card %i", cardIndex);
if (!_game) {
_game = [[CardMatchingGame alloc] initWithCardCount:[self.cardButtons count] usingPokemonCard:[self createPokemonCard]];
}
[self.game chooseCardAtIndex:cardIndex];
self.touchedCard = [self.game cardAtIndex:cardIndex];
[self updateUI];
}

- (void) updateUI
{
for (UIButton *cardButton in self.cardButtons) {
int cardIndex = [self.cardButtons indexOfObject:cardButton];
Card *card = [self.game cardAtIndex:cardIndex];
[cardButton.titleLabel setLineBreakMode:NSLineBreakByWordWrapping];
[cardButton setAttributedTitle:[self titleForCard:card]
forState:UIControlStateNormal];
[cardButton setBackgroundImage:[self backgroundImageForCard:card] forState:UIControlStateNormal];
cardButton.enabled = !card.isMatched;
}
self.scoreLabel.text = [NSString stringWithFormat:@"Score: %d", self.game.score];
self.statusLabel.lineBreakMode = NSLineBreakByWordWrapping;
self.statusLabel.numberOfLines = 0;
// [self.statusLabel setAttributedText:[self statusForGame:self.touchedCard
// currentChosenCards:self.game.currentChosenCards
// currentMatchScore:self.game.matchScore]];
}
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式