Build failed


#1

hi.

Im getting this error when modify the createItem method. page 329


}else {
      order = [[allItems lastObjetc] orderingValue] + 1.0;

compiler says: no know instance method for selector 'orderingValue’
and also says: invalid operands to binary expression (‘id’ and ‘double’)

please help.


#2

Look at the red and you will see it. You meant to write lastObject but instead wrote [color=#FF0000]lastObjetc[/color].


#3

ibex10 thanks for your help but I´m afraid that´s not the problem.

this is the pasted version of the code

 double order;
    if ([allItems count] == 0){
        order = 1.0;
    } else {
        order = [[allItems lastObject] orderingValue] + 1.0;
    }

looks like orderingValue is not being recognized


#4

I have the same problem. The problem is [allItems lastObjetc] don’t recognize orderingValue. I can’t figure out why. Did you solve this ?


#5

Ok I had 2 mistakes.

  1. I delete the old BNRItem.h and BNRItem.m from the project but not on the disk. When I created the new files I put these in another place. When I build the app Xcode used the old files.
  2. In my BNRItem I had @property (nonatomic, retain) NSDecimalNumber * orderingValue; instead @property (nonatomic) double orderingValue; that is because I had the error [allItems lastObject] orderingValue] wasn’t a double

#6

thanks jgamio.

I did not move the files to the desktop using finder, I moved them from the xcode and then deleted them but the original files were on the project directory.

I deleted the original files and fixed the problem.