ARC differences finally stopping me


#1

@dynamic orderingValue;

For a reason I haven’t been able to figure out yet, this one attribute is tripping things up. I’m getting the red stop sign on the two lines that reference accessors for this attribute:

PossessionStore.m: error: Automatic Reference Counting Issue: No known instance method for selector 'orderingValue’
PossessionStore.m: error: Automatic Reference Counting Issue: Receiver type ‘Possession’ for instance message does not declare a method with selector ‘setOrderingValue:’

I have been carefully scrutinizing the sample code from the book, and don’t see anything different, other than the source code download doesn’t use ARC. But the definition of @dynamic certainly suggests that these accessors are created dynamically. To ensure this wasn’t a typo in my code I used copy & paste from the Homepwner.xcdatamodeld Entity attribute name field for orderingValue, and pasted that into the source code.

While it’d be great to get back to the book and keep progressing, I’m almost more concerned right now with learning about what these errors are caused by and how to fix it. Why is it only the orderingValue attribute that is being flagged? I tried changing the directive from @dynamic to @synthesize, but that did not achieve what I had hoped (accessors created at compile time).

If I figure it out before anyone chimes in, I’ll edit this post and change the title to add "- solved’


#2

Can you post the Possession.h and the part of Possession.m before the methods?

I’m by no means an expert (I’m only two chapters ahead) but another set of eyes on the code might help.


#3

Yeah, I’d definitely need to see both Possession.h/.m


#4

I was having almost the exact same problem but with other attributes.

it turns out to be a typing error. I didn’t have the correct case for a line.

So – if you post your source … maybe we can help you find it.