无法理解为什么这不起作用,它只是说 id num 每次都没有被使用过......并且永远不会将它添加到数组中。对此的任何帮助将不胜感激。我几乎可以肯定错过了一些明显的东西,但这让我发疯。
- (IBAction)idNumInputEnd:(id)sender
{
// Check if ID Number has been used before, if it hasnt, add it to the list.
NSString *idNumCheck = idNumberInput.text;
if ([idNumberList containsObject:idNumCheck])
{
NSLog(@"This id number has been used before, ask user if he would like to reload the data");
}
else
{
NSLog(@"This id number hasn't been used before and is thus being added to the array");
[idNumberList addObject:idNumCheck];
}
}