ios6

How to lock orientation in UINavigationControllers

情到浓时终转凉″ 提交于 2019-12-23 02:36:26
问题 As the ShouldAutorotateToInterfaceOrientation is deprecated in iOS 6 I am not able to lock the orientation in my app. In my app I have UINavigationControllers with multiple views, some views need to support both portrait and landscape, while other views need to support portrait only. How can I over come this problem please suggest me some idea. Thanks 回答1: Use this function only work in iOS 6 -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } -

How to find/ delete the CUSTOM row detail of UITableViewCell

不想你离开。 提交于 2019-12-23 00:52:31
问题 This question is bit related to my earlier question I am newbie for iPhone application and trying to learn UITableView with JSON . I followed this video for learning. I created same example using Stoaryboard and also added new screen where I can add data. Now I was trying to delete the data. So what I did is thought is instead of below method, I will add button on each row and on clicking of that I will delete the data. - (void)tableView:(UITableView *)tableView commitEditingStyle:

Parse.com and Facebook login, runs infinite loop

流过昼夜 提交于 2019-12-22 18:01:58
问题 I updated both Parse and Facebook iOS SDKs to the latest versions, and when I try to login using Facebook my app crashes, and from the debugger I can see that it is calling 3-4 methods in an endless loop. My login code looks like this: - (void)openSession { UIViewController *topViewController = self.window.rootViewController; NSArray *permissions = [NSArray arrayWithObjects:@"user_likes", @"friends_likes", nil]; // Login PFUser using Facebook [PFFacebookUtils logInWithPermissions:permissions

iOS 6, Xcode 4.5 video not exiting when done playing

北慕城南 提交于 2019-12-22 17:48:24
问题 I am using this code to play a video on iOS 6: -(void)GrommeVideo4 { NSURL *url5 = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Flickers" ofType:@"mp4"]]; grommePlayer4 = [[MPMoviePlayerController alloc] initWithContentURL:url5]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector

CALayer renderInContext iOS7

Deadly 提交于 2019-12-22 17:39:05
问题 I'm rendering multiple layers to get one final image. One of the images contains a face, and another one contains a background with a transparent gradient around the face so that the real background is hidden. In iOS6 it works perfectly but it is creating a weird effect with the transparent gradient in iOS7. The code: CGRect rect = [[UIScreen mainScreen] bounds]; UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(); [faceImageView.layer renderInContext

replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: broken in iOS 6?

柔情痞子 提交于 2019-12-22 17:06:39
问题 I cannot get the NSFileManager method replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: to work in iOS 6. Apps that call this method and worked fine on iOS 5 have major issues on iOS 6. The problem does not occur on devices running versions of iOS below 6.0. The problem does not occur if the app is launched in the iOS Simulator by Xcode. Otherwise the problem seems to be universal. Here is the test code I am trying to execute: NSError *error; NSFileManager

NSLineBreakMode enum and backwards compatibility

房东的猫 提交于 2019-12-22 14:08:43
问题 I need my app to support iOS 5+. Since prior iOS 6 the enum lineBreakMode for line break mode in UILabel is of type UILineBreakMode, and it is of type NSLineBreakMode for iOS 6+, what should be the best (or more correct) way to check the iOS version currently running to determine the type to be used? Is it correct to directly do something like [[UIDevice currentDevice] systemVersion] , or is there a better way? Thanks! 回答1: You do not need to check the iOS version at runtime, the enum values

UIWebView on iOS 6 does not display images with relative URLs in webarchives

[亡魂溺海] 提交于 2019-12-22 13:46:35
问题 We are using webarchives in our apps sometimes as it is very convenient way to store HTML + all associated images/CSS/scripts/etc inside a single file on the desktop, put it into the project, and then load it into a UIWebView with a single call like that: NSData *webArchiveData = /* ... Load data from a single file ... */ ; [webView loadData:webArchiveData MIMEType:@"application/x-webarchive" textEncodingName:@"utf-8" baseURL:nil ]; This stopped working on iOS 6 however: the HTML is loaded,

iOS6/7 stop sound going to background using web audio API

限于喜欢 提交于 2019-12-22 13:33:02
问题 There are different solutions for the issue when you go to the background in the iPhone or iPad and the sound continuous playing, the most of them for the HMTL5 audio tag, but are not relevant if you are using Web Audio API because there are not an event like "timeupdate" and is a different concept of course. The Page Visibility API works in iOS7 only if you change of tab, but doesn't if you go to the background, in iOS6 not at all. Someone knows any way to stop/mute a sound using Web Audio

iOS6/7 stop sound going to background using web audio API

三世轮回 提交于 2019-12-22 13:32:49
问题 There are different solutions for the issue when you go to the background in the iPhone or iPad and the sound continuous playing, the most of them for the HMTL5 audio tag, but are not relevant if you are using Web Audio API because there are not an event like "timeupdate" and is a different concept of course. The Page Visibility API works in iOS7 only if you change of tab, but doesn't if you go to the background, in iOS6 not at all. Someone knows any way to stop/mute a sound using Web Audio