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

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,670
6,211
Is there a way to create additional user objects that weren't added in IB programmatically after the build? Like, if I wanted to allow users to add their own text boxes and drag them around by hitting a button.

I'm sorry, the question sounds dumb, but all I've ever heard of is using IB to add user interface elements.
 
anything you can create in IB you can also do programatically.

to create a new UITextField programatically, you would allocate memory for it and then initiate one with a frame according to a core graphics rectangle. so something like this:

Code:
UITextField *myTextField = [[UITextField alloc] initWithFrame:CGRectMake(10, 10, 25, 150)];
 
I don't use IB at all! I create all my UI at runtime. It actually seemed easier when I wrote my app. If I ever get the time to write another I'd probably do the same thing again.
 
I've written it both ways. One app uses mostly nibs and the most recent does it mostly in code. I think I prefer the latter.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.