Tono Nam
Tono Nam

Reputation: 36080

Create IBOutlet and connection with code

I am creating an iPad application that behaves like a power point presentational. I am creating several slides and each slides contains several images with basic functionality. Because I am creating so many slides it will be nice if I can create the IBOutles programmatically since I place so many buttons per slide for instance. it takes a while to place those outlets and create the connections. How can I speed up this process?

Upvotes: 2

Views: 3093

Answers (2)

Kasper K.
Kasper K.

Reputation: 201

This should be of interest to you: http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/030-Edit_User_Interfaces/edit_user_interface.html#//apple_ref/doc/uid/TP40010215-CH6-SW1

There's even a nice video tutorial if you click: "To create and connect a new outlet ..."

Good luck!

Upvotes: 1

sudo rm -rf
sudo rm -rf

Reputation: 29524

Why not just create every item programmatically?

Take a UIButton for example.

UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self 
           action:@selector(aMethod:)
 forControlEvents:UIControlEventTouchDown];
[button setTitle:@"Hello" forState:UIControlStateNormal];
button.frame = CGRectMake(40.0, 200.0, 170.0, 40.0);
[self.view addSubview:button];

Upvotes: 5

Related Questions