uiapplication

Delete a UILocalnotification at a certain indexpath

半腔热情 提交于 2019-12-11 06:17:57
问题 I have a bunch of UILocalNotifications but I only want to delete a certain one at a given indexpath, therefor [[UIApplication sharedApplication] cancelAllLocalNotifications]; wont work out for me. I know I can use [[UIApplication sharedApplication] cancelLocalNotification:UILocalNotification]; but how do I get the UILocalNotification from the given NSIndexPath? Thanks. 回答1: You can get an array of scheduled notification from: @property(nonatomic,copy) NSArray *scheduledLocalNotifications Get

System ignore iPhone rotation

為{幸葍}努か 提交于 2019-12-11 04:13:15
问题 Is there a function like beginIgnoringInteractionEvents in UIApplication that ignores rotation instead of touches? I need my app NOT to rotate just in an MPMovePlayerViewController that I present. Thanks [UPDATE] Here's my code -- MPMoviePlayerViewController *mpViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:videoURL]]; [mpViewController shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeRight]; [[UIApplication sharedApplication

How does UIApplication cancelAllLocalNotifications work between app updates?

两盒软妹~` 提交于 2019-12-11 02:36:05
问题 Does anyone know how the cancelAllLocalNotifications method works on UIApplication? I'm wondering specifically how iOS knows what to cancel. Does it know by App ID? Or does it use the version number of the app somehow? What I'm experiencing right now is more notifications than I expect. This is the workflow: Cancel all notifications on app start Schedule notifications on app exit *When scheduling, add the notification info to a "Recents" list *When scheduling, schedule only 1 notification per

Best Practice to handle the extended height status bar with a WantsFullScreenLayout app?

淺唱寂寞╮ 提交于 2019-12-10 18:20:00
问题 In an app which has the wantsFullScreenLayout set to YES , what is the best practice to handle an extended height status bar, i.e. with the extra status bar presented when a phone call or a VoIP app is present, or when the personal hotspot feature is activated? Is the UIApplicationWillChangeStatusBarOrientationNotification notification (or the corresponding delegate method of UIApplication the right way to do it, or am I overlooking something obvious? I have put up a little sample project

iOS Launching Settings -> Restrictions URL Scheme

自闭症网瘾萝莉.ら 提交于 2019-12-10 16:36:45
问题 I've recently discovered the awesome iOS5 custom Settings URL Scheme , which can be explained in detail at this great website. I've found this to work, directing the user to the Settings app from my application: [[UIApplication sharedApplication] openURL: [NSURL URLWithString:@"prefs:root=General"]]; But cannot seem to route directly to the Restrictions path via the path parameter: [[UIApplication sharedApplication] openURL: [NSURL URLWithString:@"prefs:root=General&path=Restrictions"]]; Has

UIApplication icon badge number remains at re-install [duplicate]

99封情书 提交于 2019-12-09 09:40:07
问题 This question already has answers here : Badge count is persisted after deleting an app and installing it again (4 answers) Closed 2 years ago . The UIApplication badge number is not deleted at reinstall. In case I uninstall the application when the badge has a non zero value, and then re-install it, the badge still appears in the new installation. I update the badge number in the following manner: [[UIApplication sharedApplication] setApplicationIconBadgeNumber:badgeNumber]; Tried to find a

openURL is not working when App is in background in iOS

末鹿安然 提交于 2019-12-07 08:04:24
问题 I am trying to open one URL in Safari from my App when App is in background, below is my code [[UIApplication sharedApplication]openURL:[NSURL URLWithString:strURL]]; My App is hiting the above line during debugging, but not opening Safari with the given URL. 回答1: It's not possible, You cannot launch another app from the background state. If app in background then you can't have any event for handle your app event from iPhone/iPad screen. You must have to wake up your app. You can use local

Set status bar orientation in iOS 6.0 [duplicate]

北城以北 提交于 2019-12-07 06:52:13
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: setStatusBarOrientation:animated: not working in iOS 6 In iOS 6.0, as AppDelegate by default extends UIRepsonder and not UIApplication there is no global sharedApplication object. Am I missing anything? I am trying to set status bar orientation using following and it doesn't seem to work anymore. I tested it on iOS 6.0 simulator. I know you can set status bar tint color from the plist settings but can anyone

Call using Skype.app via openURL:

时光毁灭记忆、已成空白 提交于 2019-12-07 06:19:57
问题 Does anybody know if it is possible open Skype.app to call phone via - (BOOL)openURL:(NSURL *)url UIApplication message? If it possible, what url a need pass to this message? Thanks 回答1: Just for reference, this seems to have changed when multitasking support was added: starting at least with Skype 2.1.0, this URI works fine: skype:+33123456789?call 回答2: By looking at Skype's Info.plist file (you can open it from the ipa file iTunes has downloaded), you can tell it has no URL registered, so

detect unacknowledged UILocalNotifications

爱⌒轻易说出口 提交于 2019-12-07 04:01:22
问题 It seems that didFinishLaunchingWithOptions:(NSDictionary *)launchOptions and didReceiveLocalNotification:(UILocalNotification *)notification are only triggered if the user acknowledges the UILocalNotification, for example by swiping the slider or touching the entry in iOS's Notification pull-down. Is there any way to tell that a UILocalNotification has gone off if the user ignores the UILocalNotification and re-enters the app by simply clicking on the app icon? I should mention that this