views:

26

answers:

1

I want to open the dialog box when the user clicks on a browse button in the nib. This would search for a picture he wants from his pc and upload it. How do I do this programmatically in iphone.

A: 

I'm not sure if I understand exactly what you want. But if you just want to show view on top of another view you should user the - (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated method of the UIViewController. When pressing the button you init a new UIViewController subclass that does what you wan't to do in this 'popup'. Then you present it to your current view controller by calling the presentModal... method. When you're finished you can call - (void)dismissModalViewControllerAnimated:(BOOL)animated on your 'popup' view controller to dismiss it.

V1ru8
If you want a simple dialog with an ok/cancel button and some text you could use UIAlertView but as I understand your question that is not what you want?
V1ru8
i want to open the dialogue box like it opens in any of .net projects when we have to search for something in computer.
Sneha Ambure
I've never used .net so I have no idea about that. But if you're looking for something like a file picker, there is the UIImagePickerController (http://developer.apple.com/iphone/library/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html) to pick pictures from your photo library.If you want to pick pictures from an other source than your photo library on the iPhone you have to do it yourself.
V1ru8