R – UIScrollView Disappears From Interface Builder

interface-builderiphonexcode

i have interface builder 3.1 but i don't see any UIScrollView and UIAlertView is something missing there?how can i get them in interface builder. i want a view with 50 labels and i want to add them via Interface Builder not using the code please help…

Best Answer

UIAlertView is a modal dialog, triggered within code, so it won't be very useful to set it up in Interface Builder. To create an alert, use code similar to the following:

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error message" message:@"Error description" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
[alert release];                    

UIScrollView is right there within the Interface Builder library. I don't know why you aren't seeing it. Its icon is a blank white view with a grey scroller on its right side. Even by inserting such a view within your interface, you still may need to set some parameters in code to get the scrolling to work just right.

As a conceptual comment, if you want 50 labels within a scroll view, I think you might be better served by using a UITableView instead.