Resolved NSMutableArray error I don't understand

Discussion in 'Mac Programming' started by Richard Birkett, Dec 19, 2011.

  1. macrumors member

    Joined:
    Aug 21, 2011
    #1
    I have this code:

    Code:
    - (void)multiplyWithPrimeFactor:(RBMPrimeFactor *)thePrimeFactor
    {
    	bool success = false;
    	for (RBMPrimeFactor *factor in primeFactors) {
    		if (factor.primeNumber == thePrimeFactor.primeNumber) {
    			factor.exponent += thePrimeFactor.exponent;
    			success = true;
    			break;
    		}
    	}
    	if (!success) {
    		[primeFactors addObject:thePrimeFactor];
    	}
    }
    I have studied it with breakpoints to the best of my ability. When the execution reaches the if it gets an error about using the primeFactor selector. Both 'factor' and 'thePrimeFactor' appear in the bug area to be valid 'RBMPrimeFactor's with valid integer primeFactor iVars. Here is the top of the error:

    If you would like to see more code or error text I will reply asap.

    BIG EDIT

    Really sorry, my problem was that I had @dynamic properties without implementation, such an idiot! Sorry.

    Richard
     

Share This Page