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

Re: subviews question


  • Subject: Re: subviews question
  • From: Ben Lachman <email@hidden>
  • Date: Thu, 31 Aug 2006 00:49:19 -0400

Well there are several ways an accessor can be written... one being:

- (NSArray *)subviews {
	return _subviews;
}

I would guess this is how it was written. If you want a copy you can just call [[aView subviews] copy];

->Ben
--
"I'm so cool you could keep a side of meat in me for a month! I'm so hip I have trouble seeing over my pelvis!"


- Zaphod Beeblebrox, The Hitchhiker's Guide to the Galaxy


On Aug 30, 2006, at 7:31 PM, Mu Lin wrote:

Hi, All:

I have a subclass of NSView say MyView only overide the drawRect method, when I obtain subviews using following lines in my appController:

MyView *aView; // outlet from nib
NSArray *mySubViews = [aView subViews];

Now the array mySubViews has some interesting properties, if a subview is added or removed from aView, mySubViews updates automatically, this is rather a surprise to me.
Seems to me - (NSArray *)subviews returns a reference of the internal data representation or it is a singleton. The docs doesn't mention anything about this. Any comments?




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

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >subviews question (From: Mu Lin <email@hidden>)

  • Prev by Date: Core Image filters for magnification
  • Next by Date: Re: Removing/Adding views in drawRect:
  • Previous by thread: subviews question
  • Next by thread: Re: subviews question
  • Index(es):
    • Date
    • Thread