ios6

Sharing video on Facebook fails

假装没事ソ 提交于 2019-12-03 15:23:19
I am sharing a video on Facebook using Facebook SDK 3.1.1. I have mentioned the code here. FBRequestConnection *newConnection = [[FBRequestConnection alloc] init]; // for each fbid in the array, we create a request object to fetch // the profile, along with a handler to respond to the results of the request NSString *fbid = @"me"; // create a handler block to handle the results of the request for fbid's profile FBRequestHandler handler = ^(FBRequestConnection *connection, id result, NSError *error) { // output the results of the request [self requestCompleted:connection forFbID:fbid result

iOS 6 orientation issues

倖福魔咒の 提交于 2019-12-03 15:15:03
问题 I have an application which normally is a portrait app and only show landscape view for one UIViewController. It works fine until the new iOS 6 is released. I really don't understand how orientation works in iOS 6. So I wrote a testing app. Here is what I did: Set the orientation of the application to support all orientations. I'm using story board. The rootViewController is embedded in UINavigationController which is in portrait. The code in rootViewController: -(NSUInteger

table view in popover is not scrolling

霸气de小男生 提交于 2019-12-03 15:03:45
问题 I have the code below to display popover with tableview and it works perfectly. The tableview displays 13 numbers and I can scroll and see the same but when I release mouse-touch on simulator it goes back to the top. It does not stay at the row which its displaying but takes me back to 1st to 10th row . How do I make it stay in the position after scrolling. Or any fix in the below code. Thanks in Advance. - (IBAction)btn:(id)sender { if([popoverController isPopoverVisible]) {

Detecting a change to text in UITextfield

大憨熊 提交于 2019-12-03 15:01:37
问题 I would like to be able to detect if some text is changed in a UITextField so that I can then enable a UIButton to save the changes. 回答1: Take advantage of the UITextFieldTextDidChange notification or set a delegate on the text field and watch for textField:shouldChangeCharactersInRange:replacementString . If you want to watch for changes with a notification, you'll need something like this in your code to register for the notification : [[NSNotificationCenter defaultCenter] addObserver:self

Is there a horizontal UIRefreshControl?

眉间皱痕 提交于 2019-12-03 14:57:21
You can add UIRefreshControl to UICollectionView (or any UIScrollView for that matter) by adding it to collection's subviews : UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; [refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged]; [self.collectionView addSubview:refreshControl]; This doesn't work when collection view layout has UICollectionViewScrollDirectionHorizontal . I tried overriding layoutSubviews to put refresh control to the left, but it wouldn't track scrolling progress this way. Can I trick it into working

iOS 6 UIInterfacePortrait ONLY viewcontroller being presented & stuck in landscape… when coming back from a landscape viewcontroller in nav stack

和自甴很熟 提交于 2019-12-03 14:52:54
问题 So like many others, I ran into the problem of only having one or two viewcontrollers support both portrait and landscape interface orientations, in an otherwise portrait only app. Everything worked fine prior to iOS 6, but suddenly autorotating stopped working. Thanks to some great questions here, I was able to resolve that issue by having the initial navController return the individual topViewController's preference for shouldAutorotate via: - (BOOL)shouldAutorotate { return self

Button background and gradient change since iOS6

别等时光非礼了梦想. 提交于 2019-12-03 14:39:44
For an app I had to create a UIButton filled with a gradient and a background image. Everything worked fine until I upgraded the OS from iOS 5.1 to the recently released iOS 6. Here are two screenshots from the simulator : Well, the first screenshot shows what I need (and did), you can see a brown background and the grey radient. Below is the screenshot with the same buttons but with iOS 6 running. As you can see the gradient has vanished and a strange white strip has appeared at the bottom of the UIButton . I've looked if this is a bug or something but I've found nothing, maybe someone here

Use a button on a UICollectionViewCell to display data from an array

扶醉桌前 提交于 2019-12-03 14:30:26
I have an array of NSStrings , one UILabel & a UICollectionView . My Question: I want the array's count to determine how many UICollectionViewCell 's there are. Each UICollectionViewCell contains a button. Upon click, I want this button to cause the data in the array that corresponds to the UICollectionViewCell 's number to be displayed in the label. For example, if the user clicks on the 13th UICollectionViewCell 's button, then the 13th NSString in the array would become the UILabel 's text. What I have done: I have made my own subclass of UICollectionViewCell for the nib file that I use for

Where to set translatesAutoresizingMaskIntoConstraints in Xcode 4.5

半城伤御伤魂 提交于 2019-12-03 14:29:27
问题 I need to set translatesAutoresizingMaskIntoConstraints to NO . By default it is set to YES (to assist with the majority of apps that are transitioning from struts and springs to the new Auto Layout). Is there somewhere in Xcode where the default can be changed from YES to NO ? Or do I have to manually set it for every view? 回答1: This is a great question - and one I've tried to find an answer to myself. Sadly, it looks like there is no "quick fix". Currently, Apple considers Constraint-based

Using Dictation - iOS 6 - DidStart?

与世无争的帅哥 提交于 2019-12-03 14:26:49
How to respond to starting dictation? Known ways of responding to dictation: dictationRecordingDidEnd - respond to the completion of the recognition of a dictated phrase. dictationRecognitionFailed - respond to failed dictation recognition. Reference: UITextInput Protocol Reference Starting in iOS 5.1, when the user chooses dictation input on a supported device, the system automatically inserts recognized phrases into the current text view. Methods in the UITextInput protocol allow your app to respond to the completion of dictation, as described in “Using Dictation.” You can use an object of