Add elements to View from subclass

Discussion in 'iOS Programming' started by Pades, May 9, 2014.

  1. Pades macrumors newbie

    Joined:
    Aug 6, 2013
    #1
    I have a problem with my first project in xcode. I add new class Lesson1 with main View and subview "Level1" is it possible add elements(programatically) to subview(highlighted) from class lesson1?. For example I wanna add UIButton to subview(highlighted) from Lesson.m but I dont know how. I added screenshots.
     

    Attached Files:

  2. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #2
    Yes, it's certainly possible.

    viewDidLoad is probably the best place to put your code:

    Code:
    - (void) viewDidLoad;
    {
      [super viewDidLoad];
      //Put your code to add new views here;
    }
     

Share This Page