ios6

How to load multiple storyboard files depending on iOS version? (5 and 6)

六月ゝ 毕业季﹏ 提交于 2019-12-17 18:58:43
问题 I have a tab bar controller app that I am trying to make compatible for iOS 6 and iOS 5. For iOS 6, I use auto layout. But when trying to run on iOS 5, I get an error due to it not recognizing NSLayoutConstraints. From what I can tell, I am required to use a different storyboard without auto layout enabled. I have copied my storyboard into a new one, but don't know how to set which storyboard to use in the app delegate. Whats the code to do this? 回答1: In your app delegate, you should find

Override UIAppearance property for MFMailComposeViewController

混江龙づ霸主 提交于 2019-12-17 18:33:24
问题 I am using the UIAppearance protocol to set the background image of UINavigationBar objects throughout my app. [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"image-name"] forBarMetrics:UIBarMetricsDefault]; I would like to override this for instances of MFMailComposeViewController so that the default style navigation bar is displayed. I attempted to use appearanceWhenContainedIn to set this and this works on iOS 5 but not on iOS 6. [[UINavigationBar

Block sms on ios6

陌路散爱 提交于 2019-12-17 18:11:15
问题 I'm building for a jail-broken device and I want to block incoming messages. I'm trying to hook _ingestIncomingCTMessage, but it has no result( it seems not working on ios6). How else I can block sms in ios6? 回答1: This is quite tricky. Apple made major changes in this area. It's very easy on iOS 5 but on iOS 6 I couldn't find easy way to do it yet. First, you need to observer __kIMChatItemsDidChangeNotification notification using CTTelephonyCenter. I'm doing it in dylib injected in

New image name for iPhone 5

余生颓废 提交于 2019-12-17 17:39:50
问题 With the retina we make images with the @2x in the name. I see where the default image has to be default-568h@2x but this does not seem to be the case for other images. Like if my background is bg.png and bg@2x.png I tried using bg-568h@2x.png but that does not work. Can somebody tell me what the images need to be named to support the iPhone 5? 回答1: There is no specific image name. Having the Default-568h@2x will launch that image on an iPhone 5 or iPod Touch 5G and will enable the non

iOS 6 breaks GeoLocation in webapps (apple-mobile-web-app-capable)

北战南征 提交于 2019-12-17 17:33:40
问题 I have an app that does a simple textbook navigator.geoLocation.watchPosition(...) that works great in iOS 5.x both in Safari and as a web app (using apple-mobile-web-app-capable meta tag). However, in iOS6, GeoLocation does not work in the webapp. It still works in safari as expected, but when I run the webapp, it prompts me for location permission, then silently fails. I see the location icon, but no events are thrown from watchLocation. I get no error events or any location events. Has

UICollectionView: How to define a UICollectionViewLayout that supports horizontally and vertically scrolling?

故事扮演 提交于 2019-12-17 17:33:21
问题 At the moment I'm trying to create an UICollectionView , that should display a simple excel-like-spreadsheet , with rows and columns . This should be an easy task with UICollectionViews , I believed. And I really would like to do the implementation in UICollectionView , not in any grid framework . But at the moment I'm hanging a little bit. What I've figured out is, that I unfortunately can't use a UICollectionViewDelegateFlowLayout , because this only supports scrolling in either

How to Post to Facebook on iOS 6 in Objective-C using ACAccountStore class

做~自己de王妃 提交于 2019-12-17 17:31:04
问题 I want to know how to post a status message to Facebook on iOS 6 using the new frameworks on Xcode 4.5. Thanks! :) 回答1: Posting a message is rather simple. It's almost like with the Twitter Framework. First you have to import the Frameworks: Social and Accounts #import <Social/Social.h> #import <Accounts/Accounts.h> In your .h file: SLComposeViewController *mySLComposerSheet; This code has to be included inside your action in your .m file: if([SLComposeViewController isAvailableForServiceType

Assertion failure when using UISearchDisplayController in UITableViewController

大城市里の小女人 提交于 2019-12-17 17:26:55
问题 I've been trying to add simple Search functionality to a TableViewController in my app. I followed Ray Wenderlich's tutorial. I have a tableView with some data, I added the search bar + display controller in storyboard, and then I have this code: #pragma mark - Table View - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BreedCell" forIndexPath:indexPath]; //Create

Xcode 4.5 command line unit testing

◇◆丶佛笑我妖孽 提交于 2019-12-17 17:24:37
问题 Having an issue since updating to Xcode 4.5 when running my unit tests via command line. The following is the output i'm seeing when i try to run my tests Unknown Device Type. Using UIUserInterfaceIdiomPad based on screen size Terminating since there is no workspace. /Applications/Xcode.app/Contents/Developer/Tools/RunPlatformUnitTests.include:334: note: Passed tests for architecture 'i386' (GC OFF) /Applications/Xcode.app/Contents/Developer/Tools/RunPlatformUnitTests.include:345: note:

IOS 6 NSDateFormatter

佐手、 提交于 2019-12-17 16:52:45
问题 Please help me with the dateformatter on IOS6, please see the code below NSString stringDate = @"12/31/9999"; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; [dateFormatter setDateFormat:@"MM/dd/yyyy"]; NSDate *dateCheck = [dateFormatter dateFromString:stringDate]; NSLog(@"Date = %@", dateCheck); Output is Date = 1999-12-31 08:00:00 +0000 This was the output when converting the string date to date 12/31/9999. From the previous version of IOS6 the output is Date = 9999-12-31 08