Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Pades

macrumors newbie
Original poster
Aug 6, 2013
5
0
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.
 

Attachments

  • Snímka obrazovky 2014-05-09 o 9.13.00.png
    Snímka obrazovky 2014-05-09 o 9.13.00.png
    227.3 KB · Views: 106
  • Snímka obrazovky 2014-05-09 o 9.13.28.png
    Snímka obrazovky 2014-05-09 o 9.13.28.png
    127.3 KB · Views: 119
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.

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;
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.