• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
ObjC question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ObjC question


  • Subject: ObjC question
  • From: Tony Romano <email@hidden>
  • Date: Mon, 21 Feb 2011 12:19:34 -0800
  • Thread-topic: ObjC question

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,

-Tony
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: ObjC question
      • From: Quincey Morris <email@hidden>
    • Re: ObjC question
      • From: Dan Treiman <email@hidden>
    • Re: ObjC question
      • From: "Hank Heijink (Mailinglists)" <email@hidden>
  • Prev by Date: Re: Using Bison to Build Multiple Parsers in the Same Application
  • Next by Date: Re: ObjC question
  • Previous by thread: Re: Using Bison to Build Multiple Parsers in the Same Application
  • Next by thread: Re: ObjC question
  • Index(es):
    • Date
    • Thread