I am currently going through some of the questions on project Euler and I am stuck on 7, for the way I want to solve it I need want to compare a value in an array of primes (which I store as an NSMutableArray) to a number (which I store as an int) using
if (num%[Primes objectAtIndex:currentPrime]==0){
You can’t use the modulo (or any other) operator on an object, such as an
NSNumberwhich is presumably in your array. Use theintValuemethod to convert the number in the array to the primitiveinttype:Variable names should be lowercase in Objective-C, uppercase names are conventionally reserved for class names.