Add elements to View from subclass

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

  1. Pades macrumors newbie

    Aug 6, 2013
    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

    Jan 21, 2008
    Northern Virginia
    Yes, it's certainly possible.

    viewDidLoad is probably the best place to put your code:

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

Share This Page