我有这个方法:
- (void) voteResult: (NSString *)partyName votedNumber:(int)votedNumber
{
int *moreVotes;
moreVotes = 2000 - votedNumber;
_labelVoteResult.text = @"Currently, your party (%x) has %i votes. We need %i more votes to put %x on our list. Share to your Facebook or Twitter to get more votes from your downline or upline.", partyName, votedNumber, moreVotes, partyName;
}
但我收到此错误消息:
Incompatible integer to pointer conversion assigning to 'int *' from 'int'
因为这条线:
moreVotes = 2000 - votedNumber;
我也有这个错误信息:
Expression result unused
因为这一行 ( partyName
) :
_labelVoteResult.text = @"Currently, your party (%x) has %i votes. We need %i more votes to put %x on our list. Share to your Facebook or Twitter to get more votes from your downline or upline.", partyName, votedNumber, moreVotes, partyName;
最后一件事,%x 应该是一个字符串,但 Objective C 只有 %i 代表整数,%c 代表字符。我不知道字符串到底是什么。
谢谢你。