How do I get a pop-up to display on my iphone application? - iphone

I would like to know how to display a pop-up with some text, in an iphone application that I am developing. The part of the app I am talking about consists of some text pulled in from a plist file, all this happens in a view controller object which also consists of a button. When the user presses the button, I would like to show a pop-up window (not a small alert like the one obtained using UIAlertView but one similar to the pop-up ads that appear when you launch certain apps on the iphone, with the background dim and a window with a close button etc etc..), ya so anyway I would like to know how to achieve this, mainly if there is any pre-defined class that can make this happen. Any help would be highly appreciated. Thanks in advance.

You could use MBProgressHUD for this. You can add custom views in it and it also has the dimBackground property to dim the containing view and many other useful things.

Related

Instruments UI Automation tests for iPhone app

I'm a newbie in UI Automation using instruments and I have the following question:
- the application starts and I get the mainWindow screen (which contains SignIn and Register buttons)
- I've managed to write the JavaScript code in order to tap one of the two buttons.
-> after tapping one of the buttons, another screen is displayed. let's say the Sign In screen which contains two fields: username and password.
In this case, how can I tell Instruments that this is another screen and this contains another elements that should be retrieved in order to fill the fields and tap the Sign In button ?
I only know to retrieve the mainWindow. I don't know how to write the code for a next screen
Did you try to capture what you do with the small record button in the Javascript editor window? That way you can find out how Instruments can call the elements you use.
See also this thread:
UI Automation - how to capture - record using javascript editor

How would I go about detecting links in TTTAttributedLabel?

I have a table view and in some of the cells there are links, I want to be allow the user to click on these links and view them in a webView (which I have already made). I don't want to use the row selection event because there may be more than one link in the cell. I came across TTTAttributedLabel and think it will be ideal. I don't need to add any style to the text in the cell, I only need to detect the links and capture the click event to open up my webview.
Any help would be greatly appreciated.
It looks like you can assign a TTTAttributedLabelDelegate to a TTTAttributedLabel that will get call backs for when a user selects different link types, but no opportunity for you to capture them and open your own web view (which I think is what you're trying to accomplish).
Instead, you might wanna check out OHAttributedLabel. It's similar in functionality, but when a user clicks on one of the links in the label, it calls -(BOOL)attributedLabel:(OHAttributedLabel*)attributedLabel shouldFollowLink:(NSTextCheckingResult*)linkInfo on it's OHAttributedLabelDelegate, which gives you the opportunity to handle the link tap yourself if you return NO.

One Xib file for 2 states: showing & editing a object

The contacts application of the iPhone is a good illustration of my problem. Apple uses one view to show and edit contacts at the same time. When a user wants to edit a contact he simply presses the edit button on the right side of the navcontroller. The 'show contact' interface changes to the 'edit contact' interface and the user is able to edit the contact. When the user is finished editing he presses the 'done' button.
My question is, what is the easiest way to achieve this behavior?
I believe the iPhone CoreData Recipes sample code has everything you need, they have a page that is exactly as you describe:
http://developer.apple.com/library/ios/#samplecode/iPhoneCoreDataRecipes/Listings/ReadMe_txt.html
The short answer is that you can achieve this by using to separate view xibs which you can swap in and out. Personally I prefer to simply use code to hide and show the controls that need to change between the two views.

iPhone: A built in way to show the user a simple warning/alert message

I have a custom built sign up component that I would like to enhance. I would like to show error messages before sending the data to the server (like "invalid email") using a built in alert system (other than modal) if possible. Is there any on iOS? Do I have to build one myself? I saw that some apps show a grey rectangle near the bottom of the screen, is that custom built?
Thanks!
Check out this code sample if you want to use Tweetbot style notifications in your application, these are non modal
http://blog.mugunthkumar.com/coding/ios-code-tweetbot-like-alertpanels/
All iOS alerts are modal (for now). You will have to build your own if you want different functionality, but it isn't too difficult. You can put together a little UIView with a label that is normally hidden. Then just set the text and show it when you need to.

How do I create a simple two-screen iPhone app?

I've gone through most of the example code and I still need some help. I want to make an uber-simple app: show one screen at startup with a label and a button. click the button and we slide over to another screen (I suppose these are called views) which has another label and the "back" button in the top menu bar. I just want to click back and forth between the two screens.
How do I do this?
Take a look at the NavBar sample on Apple's Developer website. http://developer.apple.com/iphone/library/samplecode/NavBar/index.html
You'll need to use a UINavigationController to accomplish the "slide"/"back button" behavior you're talking about. It is as simple as you might think, as long as the app is setup correctly. Essentially, UINavigationControllers allow you to push and pop instances of UIViewController or subclasses thereof, and take care of the animation and view history tracking for you.
The best way to get started, by far, is just open XCode, choose "New Project", and start with the "Navigation-Based Application." Dig around that project for a while and I think you'll start to see clearly what needs to be done.
You can checkout how to get started with that using this tutorial: at wattz.net