views:

444

answers:

1

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...

+3  A: 

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.

Brad Larson
in my interface builder i don't see any uiscrollview. is it some kind of installation problem
Rahul Vyas
Make sure your Interface Builder project is a Cocoa Touch one (Window, View, etc.). Go to the Library dialog box and type the letters "sc" in the search bar at its bottom. That should refine the list of interface elements down to just the UIScrollView. If that is missing, your Xcode installation may indeed be broken. Download and reinstall the iPhone 2.2.1 SDK in that case.
Brad Larson