Reusing CGRect

4 views
Skip to first unread message

Bradley S. O'Hearne

unread,
Nov 1, 2009, 9:05:26 PM11/1/09
to xcodep...@googlegroups.com
Quickie question....

If I have several UIViews that I want to make the same size and
location, can I reuse the same CGRect instance to set each view's
frame, or do I need to create a separate CGRect with the same x, y,
width, and height values to assign to each view?

I have somewhat confusingly seen both of these techniques in sample
code.

Thanks,

Brad

Jiva DeVoe

unread,
Nov 1, 2009, 10:01:54 PM11/1/09
to xcodep...@googlegroups.com
CGRect is just a struct, and when passed as an argument, it's passed
by value just like ints/floats/etc. So in short, yeah, you can reuse
it np.
--
Jiva DeVoe
http://www.random-ideas.net
What's Goin Down - Network Management Tools for your iPhone.

Reply all
Reply to author
Forward
0 new messages