• 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
Syntax question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Syntax question


  • Subject: Syntax question
  • From: Hisaoki Nishida <email@hidden>
  • Date: Sat, 25 May 2002 03:10:34 -0400

Would this code work as expected?

[tileInfoList objectAtIndex:tileNum]->rcSrc->origin->x = tRect.origin.x;

tileInfoList is a NSMutableArray.
tileNum is an int.
rcSrc is NSRect.
tRect is also NSRect.
You can assume that the object pointed to by tileNum is a struct containing rcSrc.
But I'm not sure if it will be recognized as a struct, and instead an id?
If so, what should I do?

What I expect to be done is substitute the x value in tRect.origin to the NSRect.origin.x struct element in the tileInfoList array.

[tileInfoList objectAtIndex:tileNum] returns the struct by reference (?) so I thought that '->' would work here. Unless I have to typecast the struct or something?

Thanks!
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Syntax question
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: Why can't I introduce new variables after init stage?
  • Next by Date: Re: Why can't I introduce new variables after init stage?
  • Previous by thread: NSDateFormatter bug??
  • Next by thread: Re: Syntax question
  • Index(es):
    • Date
    • Thread