objective c - Custom view not displaying when attempting to change background color -


this first mac application. i've written ios before , have been able accomplish same goal.

i'm trying change background color of custom view. in photo below, 2 views named view0 , view1.

here's code i'm trying use accomplish (in appdelegate.m file):

- (ibaction)uppressed:(id)sender {     nslog(@"uppressed");      self.view0.layer.backgroundcolor = cgcolorcreategenericrgb(1, 0, 0, 1); } 

i'd color of view0 turn red upon pressing button. button click registers fine.

when run simulator, views not show up.

upon clicking button, nothing changes.

why single line of code inadequate? in ios, able use similar method of setting background color of view make color change.

enter image description here

select custom view , select 'show view effects inspector' in right pane (looks 3 pieces of paper on top of each other in utilities window). check box next custom view under core animation layer. enable core animation view type.

xcode


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -