I have this object definition:
@interface BTreeNode : NSObject
{
NSObject *item;
BTKey *key;
BTreeNode *left;
BTreeNode *right;
}
@property (assign) NSObject *item;
@property (assign) BTKey *key;
@property (assign) BTreeNode *left;
@property (assign) BTreeNode *right;
I have a method that has this signature:
-(void) insert: (BTreeNode **) node node:(BTreeNode *) n;
I'm trying to do this:
-(void) insert: (BTreeNode **) node node:(BTreeNode *) n
{
…
// get the address of the left member
[self insert:&[(*node) left] node:n]; // <--- error
}
The compiler(GCC 4.2 or LLVM 1.6) is giving this error : address _expression_ must be an lvalue or a function designator.
I was assuming the return value for [[(*node) left]] is a lvalue (it's a pointer) and I should be able to obtain the address of that pointer but either you can't or the value returned from the message call to node is not a lvalue.
This, [(*node) left], returns the correct object; however, I need to know the address of the object to pass in. What is the proper syntax?
Thanks in Advance,