Comparing in objective C - Implicit conversion of 'int' to 'id' is disallowed with ARC

前端 未结 2 1551
庸人自扰
庸人自扰 2020-12-20 14:54

I i\'m getting the error \"Implicit conversion of \'int\' to \'id\' is disallowed with ARC\" at the line marked with \"faulty line\". I guess it have something to do with th

2条回答
  •  庸人自扰
    2020-12-20 15:52

    You are using an int where an object (presumably NSNumber) is expected. So convert before use:

    if ([drawnNumbers containsObject:@( drawnNumber )])
    

提交回复
热议问题