UIView initWithFrame: not called when using nib

Discussion in 'iOS Programming' started by CarlosH, Jan 23, 2009.

  1. CarlosH macrumors member

    Joined:
    Apr 9, 2008
    Location:
    San Francisco, CA
    #1
    I usually dont use nibs, but I want to do a view using only nib, but also need to do some drawing on code. Everything works fine, except that the initFromFrame: method is never called withing the view. Do I need to add something?
     
  2. xsmasher macrumors regular

    xsmasher

    Joined:
    Jul 18, 2008
    #2
    Yes, initWithCoder is called instead. Change your initWithFrame to initWithCoder; it expects an NSCoder instead of a frame, though.
     
  3. CarlosH thread starter macrumors member

    Joined:
    Apr 9, 2008
    Location:
    San Francisco, CA
    #3
    Thanks. That's what I needed.
     

Share This Page