Page 73 -- adding _weak causes build to fail


#1

I’m on the portion where you change the container instance variable to be a weak reference with:

When I add _weak I get an error on that line that says “Expected ; at the end of declaration list” and “Unknown type name ‘_weak’”

Here’s a snippet of that portion of my code and note that everything works if I remove “_weak”

[code]@interface BNRItem : NSObject

{
NSString *_itemName;
NSString *_serialNumber;
int _valueInDollars;
NSDate *_dateCreated;

BNRItem *_containedItem;
_weak BNRItem *_container;

}
[/code]

Thanks in advance!


#2

try using two underscores
__weak


#3

[quote=“xjames”]try using two underscores
__weak[/quote]

That worked, thanks!