objective c - Creating a error-handling UIView Overlay -
I have tab bar controller inside a navigation controller with a 320x411 image (except the status bar, and tab bar) I want to make a scene.
The picture is shown for network connection error.
Currently I have a tab bar in the view of the personal view of the item:
if (appDelegate.hasInternetAtStart == NO) {CGRect myImageRect = CGRectMake (0.0f, 0.0) F, 320.0f, 480.0) f); UIImageView * myImage = [[UIImageView alloc] initWithFrame: myImageRect]; [MyImage Set Image: [UIImage imageNamed: @ "NetworkError.png"]]; MyImage.opaque = Yes; [Self.view pushViewController: myImage animated: no]; [MyImage release]; }
However, it is permitting to touch and access the elements below.
Is there a correct way to show an error, or should I choose another option method?
I would like a single view, which will override all the other scenes in tab bar item, and if possible it can be set in app delegate ...
Did you try to launch your UIImageView from within the App Rep?
By doing so, shape the scene and your image, using a PNG transparency image of the entire screen, your error will display to the user without touching the NavController tab bar.
If you want to trigger it from outside the app representative, you can use NSNotificationCenter to create a Respondent in such an app representative.
// register listener [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector (showNetworkError) Name: @ "showNetworkError" object: zero];
And like it, call from outside the adial:
// post notification [[NSNetificationcenter default center] PostNotificationName: @ "ShotNetworkArror Object": Self];
Note that the selector is the name of the "show networkwork" function that shows the error UIImageView.
Comments
Post a Comment