ios8.1

Convert between date formats in Objective-C

一笑奈何 提交于 2019-12-24 16:31:10
问题 I am trying to convert a date into a different format. I'm receiving my date as an NSString with the following format: EEE MMM dd HH:mm:ss ZZZ yyyy , and am attempting to change it to this format: dd-mm-yy . However, I am not able to get it in desired format. This is my current code: NSString *dateStr = [NSString stringWithFormat:@"%@",[dict valueForKey:@"createdOn"]]; [dateFormatter setDateFormat:@"EEE MMM dd HH:mm:ss zzz yyyy"]; NSTimeZone *gmt = [NSTimeZone timeZoneWithAbbreviation:@"IST"]

Push notifications are not working in updated version from ios7 to ios8.1

試著忘記壹切 提交于 2019-12-24 14:27:44
问题 I updated my device from ios7 to ios8.1.Push notifications are not working in updated version. I did same process for push notifications which is done in ios7. The code is also updated #ifdef __IPHONE_8_0 //Right, that is the point UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeBadge |UIUserNotificationTypeSound |UIUserNotificationTypeAlert) categories:nil]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings

Swift: how to set up an audio session that gracefully mixes with others (aka Pod)

吃可爱长大的小学妹 提交于 2019-12-24 02:37:04
问题 This code snippet makes the other audio (aka iPod) to stop: func setSessionPlayer() { var audioSessionError: NSError? let audioSession = AVAudioSession.sharedInstance() audioSession.setActive(true, error: nil) if audioSession.setCategory(AVAudioSessionCategoryPlayback, withOptions:AVAudioSessionCategoryOptions.MixWithOthers, error: &audioSessionError) { println("Successfully set the audio session") } else { println("Could not set the audio session") } } What am I missing? 回答1: I think it's

UIAccessibilityFocus protocol not working

荒凉一梦 提交于 2019-12-23 17:26:16
问题 I want to know when a user shifts the focus away from an accessibility element. I have tried overriding the accessibilityElementDidLoseFocus() and accessibilityElementDidBecomeFocused() methods but the methods doesn't seem to be called upon when I navigate to other elements in VoiceOver accessibility mode. I have no idea what is wrong. Is there anything else that I should do to activate these methods? override func accessibilityElementDidBecomeFocused() { println("become focused") } override

Camera show black screen in ios 8

房东的猫 提交于 2019-12-21 20:12:46
问题 This code for capturing image one by one from camera,but after taking one image next time camera will open but with black screen(like it,s shutter close).all other ios version its working,but not working in ios 8.please tell me how can i solve it? -(void)openCamera { if(![PickerHandler doesDeviceSupportMediaType:ITEM_TYPE_PHOTO]) { [PickerHandler showNoDeviceSupportWarningForMediaType:ITEM_TYPE_PHOTO withDelegate:self]; } else { UIImagePickerController *picker = [[UIImagePickerController

NSURLSessionDataDelegate method didReceiveData and others are not called

安稳与你 提交于 2019-12-21 11:22:58
问题 I am having a problem that didReceiveData and didCompleteWithError are not called. Here is my code : class LoginViewController: UIViewController, NSURLSessionDataDelegate, NSURLSessionDelegate, NSURLSessionTaskDelegate { . . . } @IBAction func loginAction(sender: AnyObject) { var sessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration() var session = NSURLSession(configuration: sessionConfiguration, delegate: self, delegateQueue:nil) let postParams = "email="+"rabcd@gmail

NSURLSessionDataDelegate method didReceiveData and others are not called

一曲冷凌霜 提交于 2019-12-21 11:22:32
问题 I am having a problem that didReceiveData and didCompleteWithError are not called. Here is my code : class LoginViewController: UIViewController, NSURLSessionDataDelegate, NSURLSessionDelegate, NSURLSessionTaskDelegate { . . . } @IBAction func loginAction(sender: AnyObject) { var sessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration() var session = NSURLSession(configuration: sessionConfiguration, delegate: self, delegateQueue:nil) let postParams = "email="+"rabcd@gmail

NSURLSessionDataDelegate method didReceiveData and others are not called

ぐ巨炮叔叔 提交于 2019-12-21 11:22:30
问题 I am having a problem that didReceiveData and didCompleteWithError are not called. Here is my code : class LoginViewController: UIViewController, NSURLSessionDataDelegate, NSURLSessionDelegate, NSURLSessionTaskDelegate { . . . } @IBAction func loginAction(sender: AnyObject) { var sessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration() var session = NSURLSession(configuration: sessionConfiguration, delegate: self, delegateQueue:nil) let postParams = "email="+"rabcd@gmail

Headphones plugin/out detection in Swift

时光毁灭记忆、已成空白 提交于 2019-12-20 17:24:13
问题 im working on an iphone app for iOS 8.1 that works with core audio to generate frequencies and adjust intensities. In the view controller that i generate the frequencies i need to control if the headphones are plugged out in some moment, i'm already controlling if headphones are connected before proceed to my frequencies generator view with the following function: - (BOOL)isHeadsetPluggedIn { AVAudioSessionRouteDescription* route = [[AVAudioSession sharedInstance] currentRoute]; for

GameCenter: endTurnWithNextParticipants not advancing

一世执手 提交于 2019-12-20 06:26:56
问题 In the sandbox environment, I'm having trouble advancing a turnbased match to the next player. Initial conditions: Player A and Player B on Device A and Device B, respectively. Both logged into the sandbox Both players can see each other's GC status message Player A creates a match and invites player B Player A ends the turn In my "end turn" function I do the following: NSLog(@"size = %ld", updatedMatchData.length); //move the current player to the bottom of the list NSMutableArray