In my application, I want to create a dialog box with one text field, and a button, through which I can prompt user and get back user entered value.
How do I do this
I believe what you are looking for is a sheet. Have a look at the Sheet Programming Topics documentation
I've just updated a Github Sample project on this. You can enter text in a field on the sheet and pass that back to the main window.
This example shows how to create a view in a nib and use a custom sheet controller class which uses a block as the callback, rather than having to create and pass in a selector.