Notification center vs UIActionSheet - iphone

Maybe somebody faced this kind of trouble: when using UIActionSheet on ios 5 i can call Notification Center. The problem is that i cant touch any event in NC. And it all looks not clean. So, is there some way to disable NC by program or maybe another ways to solve it?
Thanks!

I found out a quick solution:
when the Notification Center shows up, appDelegate receives (applicationWillResignActive:) and there I post a notification to remove my UIActionSheet from the screen. It's not clean but better than it was.

Related

UILocalNotifications while app is in foreground

I know similar types of question have been asked before but I'm trying to achieve a particular effect:
I understand I can listen in,
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
and handle the notification myself, however I don't just want to display a custom alert or UIAlertView,
I actually want the UILocalNotification to show as it would when the app is in the background.
i.e.
The reason i'd like this is, it's play a sound itself, and the banner looks pretty.
Any thoughts?
Regards,
John
Only two solutions come to mind. The first is not feasible: it would involve creating another app with a different signature and somehow have it manage the notifications. I don't even want to think this through - it seems like a bad idea.
Therefore, you just have to reengineer the notification popup. A simple view with rounded corners, animating in via rotation etc. Should be doable without too much trouble.
This control might help you achieve the effect you're seeking:
https://www.cocoacontrols.com/controls/mpnotificationview

AVFoudationFramework: StillImageCapture: how to exit from AVFF?

I have a question or two about using AVFoundationFramework in XCode.
I downloaded AVCamDemo source code. I am trying to leverage the code in my app to replace UIImagePickerController (because it is slow) with the AVFF functionality. However, I cannot figure out how to exit the AVFF code when "Done" button is tapped in the UI. My app will provide the Done button.
Specifically, I need to know:
What do i need to stop the capture session? Just [session stopRunning] ??
My app's ViewController will invoke the AVFF, and will provide the "Done" button in the view controller that I will create for the AVFF functionality. When the user taps the "Done" button, I need to stop the capture process and exit back to my app. I am not sure how this can be done.
Any help will be highly appreciated.
Regards, Sam.
Yes. Although you may also want to ensure you turn the video torch off if you had turned it on, and if you called lockForConfiguration on the device you should be sure to unlock it.
There is no "exiting". If you presented your view controller using presentModalViewController:animated:, use dismissModalViewControllerAnimated:. If you pushed it onto a UINavigationController, pop it back off. If you did it some other way, dismiss it in the way appropriate for that method.
regarding your question on AVFoundationFramework:
I don't exactly understand what you are not succeeding to do. Some general options:
[session stop] will stop capturing.
You can play with the AVCaptureVideoPreviewLayer layer - that's what actually shows the camera preview.
All the ui code is in AVCamViewController - so you can just pop it from the stack, or remove it from superview - which ever is correct in your code.
If these don't help, please try to elaborate further on the problem, and perhaps supply some code.
Cheers,
Oded.

UIAlertView disappears when app goes to background and come back to foreground

I am developing an iPhone application (iPhone with multi tasking support) in which I am displaying UIAlertView on error. When UIAlertView is about to get display my app is sent to background. Now, if I try to get my app in the foreground, UIAlertView gets displayed for a moment and gets dismissed automatically even if I don't call dismiss/click on any button.
Does anyone knows what the problem is?
Thanks and Regards,
Deepa
When you add an alert view, it is added on top of the view of the current viewcontroller and while coming back to foreground , sometimes the view is reloaded from the xib and all the contents are refreshed. I suggest you to maintain a state variable in controller which calls the alertView again when coming back to foreground.
Rajact answer is good if by 'call' means the next
[theViewWhenYouAddedIt bringSubviewToFront:theViewWhenYouAddedIt.theAlert];
This worked for me
I hope this helps someone

How do I hide an infoButton in a utility app from the MainViewController when the infoButton is in the RootViewController?

How would I go about updating an object declared in the RootViewController from my MainViewController?
I'm attempting to hide my info button when my iAd is tapped, I have all the relevant pieces of code for the iAd in place, but can't figure out how to code the action. I saw an example of a similar situation online that was like this:
((MainViewController *)parentViewController).infoButton.hidden = #"";
I haven't been able to get that to work though, I just need this one value modifiable from the MVC, can anyone give me a simple suggestion?
P.S. I'm a total n00b and a snippet of code would help a great deal, I'm kind of learning as I go, thanks!
I figured this out through use of the NSNotificationCenter

Hitting the Done button does not dismiss the View of a MPMoviePlayerController on OS 4.0 beta

Hope someone can help me on this, on the old OS version 3.0 and down , hitting the done button one playing a Video would automatically dismiss the view, but now since we have to control the view appearance, hitting the Done just stops the movie but does not dismiss the view, I tried to check if it was linked to any notification and found that each time the Done button was hit, MPMoviePlayerPlaybackStateDidChangeNotification is triggered the problem is that the same notification is received for any change of state pausing /playing... so dismissing the view when MPMoviePlayerPlaybackStateDidChangeNotification is triggered is not an option. does anyone have an answer for this problem
Thx for your help
OS 4.0 beta is under NDA, you should not talk about it in SO till its released, you should post this in the apple developer forums, if u think its a bug file one...
iPhone OS 4.0 beta is currently under NDA. I recommend using the developer forums.
However, I will assume the done button does something if not dismiss the view itself. Check the documentation to see if there is another delegate method or notification that the done button has been pressed so you can dismiss the view yourself.