ios6

NSAttributedString Color Test

家住魔仙堡 提交于 2019-12-03 14:12:23
What is the correct way to compare, or test, for a particular color attribute of an NSAttributed string? As an example, I'd like to know if the text selection has red text. I have tried several approaches, as you can see below, but none of them ever results in a match. I see the text turn red on screen, and logging the attribute returns: UIDeviceRGBColorSpace 1 0 0 1 - (BOOL)isRedWithAttributes:(NSDictionary *)attributes { BOOL isRedWithAttributes = NO; if (attributes != nil) { // if ( [attributes objectForKey:NSForegroundColorAttributeName] == [UIColor redColor] ) // if ( [attributes

UIButton touch up inside event not working in ios5 while it's ok in ios6

99封情书 提交于 2019-12-03 14:00:05
I had a project which contains lots of UIButton, using xcode 4.5 and storyboard and ARC. after testing in ios6, everything goes fine. But in ios5, UIButton touch up inside event not working, the action not called. I tried to use touch down and it works. However, I have a lot of UIButton, I cannot change that one by one. what's more, the touch down event does give a good experience. I used code below in many of my view controllers: in viewDidLoad: UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissKeyboard)]; [self.view addGestureRecognizer

viewWillAppear called twice with custom segue animation using transitionFromView

此生再无相见时 提交于 2019-12-03 13:57:32
I'm looking to perform a segue to replace the window's root view controller by another view controller using a curl up animation. The idea is that I have a SplashViewController being displayed for a couple of seconds before transitioning ( performSegueWithIdentifier: ) to the next one, LoginViewController , using the curl up animation. I've created a custom UIStoryboardSegue class called AnimatedSegue . Here is the code of the overridden perform method: - (void)perform { UIViewController *source = self.sourceViewController; UIViewController *destination = self.destinationViewController;

Floating point textures in OpenGL ES 2.0 on iOS without clamping them to [0, 1]

心不动则不痛 提交于 2019-12-03 13:53:18
I need gl_FragColor to "paint" floating point values, which also can be negative (x < 0) and > 1.0. I then want to use the color attachement of the FBO this values where rendered to and use it as a texture in another FBO. Now I have read on http://www.khronos.org/opengles/sdk/docs/man/ (under glTexImage2D) that all values are clamped to a range of [0, 1] and also I didn't find a glClampColor instruction. Is there a possibility to find a workaround here or does somebody have an idea which could help me with my problem? :) SOLVED It is possible and the values are not clamped to [0, 1] at all,

Unwanted Vertical Padding from iOS 6 on CATextLayer

北城余情 提交于 2019-12-03 13:50:39
问题 Background: I started my project in iOS 5 and built out a beautiful button with layer. I added a textLayer onto the button and center it using the following code: float textLayerVerticlePadding = ((self.bounds.size.height - fontSize) /2); textLayer = [[CATextLayer alloc]init]; [textLayer setFrame:CGRectOffset(self.bounds, 0, textLayerVerticlePadding)]; It works great and looks dead center until iOS 6. Problem: iOS 6 added a space (padding) between the topmost bound and the text in textLayer.

UIWebView Delegate get MIME Type

这一生的挚爱 提交于 2019-12-03 13:48:04
问题 The UIWebView does not automatically support processing of Passbook .pkpass files. In this technical note, Apple recommend implementing a check via the UIWebViewDelegate methods to sniff out the MIME type and process it accordingly. To add passes using a UIWebView, implement the appropriate UIWebViewDelegate methods to identify when the view loads data with a MIME type of application/vnd.apple.pkpass However, I cannot find anything within the UIWebView Delegate Protocol Reference that is

how to get the cell value of a selected cell from Table view in iPhone

人盡茶涼 提交于 2019-12-03 13:43:24
Am displaying images in a table view controller where the images are rendered from the URL as XML file. It works well with listing images as scroll view. Now i want to select a particular image and the window should show the selected Cell images alone. For this do i need to get the Cell value. If so how can i get the particular cell value and display its corresponding images as a collection view in next window. Kindly suggest me an idea. For your better understanding i pasted below an image how my storyboard currently looks and how i need an output. Hope you understand my problem. Vinayak Kini

Load different Storyboard for iPhone 5 @ app start

删除回忆录丶 提交于 2019-12-03 13:36:14
问题 I am using the following code in my AppDelegate.m to detect which device the user is using: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { CGSize result = [[UIScreen mainScreen] bounds].size; if(result.height == 480) { NSLog(@"iPhone 3,5 Inch"); [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil]; } if(result.height == 568) { NSLog(@"iPhone 4 Inch");

Handling a view controller that slides in with either way swipe

…衆ロ難τιáo~ 提交于 2019-12-03 13:27:38
问题 I am building an application that is for iOS6+. The application will have a main View Controller at one point in the application. I would like this main view controller to handle a swipe left and swipe right on screen to then show another view controller. Is there an easy way to accomplish this in core iOS6+, or should I look for another library etc. I already use a slide in menu style else where in the application. I also understand and can find a million alternatives to these. What I am

Get Facebook uid from ACAccountStore in iOS?

我的梦境 提交于 2019-12-03 13:05:47
Hi i want to get the Facebook user's UID from ACAccountStore in iOS 6 self.accountStore = [[ACAccountStore alloc]init]; ACAccountType *FBaccountType= [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook]; NSString *key = @"01234567890123"; NSDictionary *dictFB = [NSDictionary dictionaryWithObjectsAndKeys:key,ACFacebookAppIdKey,@[@"email"],ACFacebookPermissionsKey, nil]; [self.accountStore requestAccessToAccountsWithType:FBaccountType options:dictFB completion: ^(BOOL granted, NSError *e) { if (granted) { NSArray *accounts = [self.accountStore