i want to create a UIView programatically... so i have the 2 main
methods of UIView:  InitWithFrame, and drawRect.

i don't understand the difference between the 2.  i think i'm suppose
to simply set the frame size in initWithFrame method, and set
attributes (like background color, and clipping masks, etc.) in the
drawRect method.



- (id)initWithFrame:(CGRect)frame
        {
        if (self = [super initWithFrame:frame])
                {
                CGRect fullScreenRect = [[UIScreen mainScreen] bounds];
                frame = fullScreenRect;
                }
                return self;
        }

- (void)drawRect:(CGRect)rect
        {
        self.backgroundColor = [UIColor blueColor];
        }



i know this is wrong (since my main app controller isn't adding this
view it to it's subview), but it's what makes sense to me...  can
someone make sense of all this for me?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to