Tableview with custom cell is not working in iOS7 - objective-c

I am working on a iOS7 application , I am presenting a modal view controller which contains a table view with custom cell. Custom cell contains a label and a textfield.
For iOS6 , my code is working perfect, but when I am running my application in iOS7 iPad, tableview delegate method tableView:didSelectRowAtIndexPath: does not get called.
Any help is appreciated.

Related

Storyboards and UISplitViewController not working under iOS 7

I have an app that must support iOS 7-9. The views are laid out in storyboard, it's a tab bar controller, with each tab containing a split view controller.
Everything works fine, except with an iPhone running iOS 7. I have the following code to collapse the split view controller to show the detail:
UINavigationController *splitNav = self.navigationController;
UISplitViewController *split = splitNav.splitViewController;
split.delegate = self;
But on the iOS 7 iPhone, split is nil (as there is no split view controller under iPhone on iOS 7) so splitViewController: shouldHideViewController: inOrientation: never gets called and I'm stuck in a weird state.
I tried push the detail controller onto the navigation controller manually, but the view never loads (just get a black screen), although the controller logic executes.
Can I either set that behavior with with storyboard instead of in code or is there some other way to reference the detail of a split view controller that doesn't exist?

Modal view before UITabBarController

Im trying to present a modal view controller from subclass of UITabBarController. I present it from viewDidLayoutSubviews method. Everything works fine on iOS 7 but in iOS 8 when app stars i still breafly see TabBarControllers first tab.
TabBarController is set as initial view controller in storyboard.
Is this even a good way to present it or there is something for iOS 8 that i dont know?
I don't have the rep to post a comment, so I'll seek clarification and provide guidance through this answer.
Is the intention that the modally presented view controller will be the first thing people see when they launch the app? And then I suppose it gets dismissed, and behind it will be the tabbar controller? How is your storyboard currently set up for the modal view controller if the tabbar is set to be the initial view controller?
One place to start could be to move to code to viewWillLoad or viewDidLoad rather than viewDidLayoutSubviews. I could also suggest to just make the modal VC the initial view controller

UISplitViewController not working correct in portrait mode on iPad

I am working on an iOS 8 app that is using a UISplitViewController. I have a custom subclass of UISplitViewController and the app is working fine except for one small issue.
I have a button in my table view in the master that brings up a modal form sheet. The form sheet has a done button that is triggering an unwind segue that is handled in my custom subclass of UISplitViewController. This method gets called in all orientations on the iPhone and in landscape on the iPad but in portrait when the master view is a popup my method does not get called. It is like the split view is no longer in the chain so when iOS is looking for a controller that handles the unwind segue method it doesn't go all the way up to the split view. Has anyone seen this before and have any idea how to handle this situation?

3 programmatically created UIButtons - how to go between 3 UIViewControllers using those buttons with Storyboard?

Playing around with some Objective-C (well, iOS) and have done the following... loaded some UIButtons programmatically into a UIScrollView. That works well. Though I've always just connected UIViewControllers together using control-click and drag. Now I've created buttons programmatically, I have no idea how to go from one view controller to another in a Storyboard because there is nothing to drag from!
I'm not really sure what code to post as such, because I haven't done anything that /nearly/ works or doesn't work as such. I get how to do it with XIBs. But I suppose the question is : 3 UIButtons have been created programmatically and I have 3 UIViewControllers. How do I access those ViewControllers using my UIButtons?
Thanks
In the Interface builder view control click and drag from the viewcontroller icon under the first view controller, to the middle of the second view controller. A segue will be created, selected the appropriate type.
Now select the segue and in the inspector give it a unique identifier (say 'myNewSegue').
Now in your first viewcontroller you can create a method that has the following code:
-(void)myButtonAction:(id)sender {
[self performSegueWithIdentifier:#"myNewSegue" sender:self];
}
And add this method as a target action to your button:
[myButton addTarget:self
action:#selector(myButtonAction:)
forControlEvents:UIControlEventTouchUpInside];]
A segue doesn't have to have a button at the leading end of it; you can instead draw it from an entire view controller to another. You can also give a segue an identifier, a string that's used as a name for that segue. Once you've done that, you can programmatically trigger that segue by calling -performSegueWithIdentifier:sender:.
To actually call -performSegueWithIdentifier:sender:, though, you'll need to connect the button to a target and action. If you've never done that, read the Event Handling Guide for iOS in your documentation.

UISearchBar doesn't work in an IOS 6 Popover

The app has a UIView with a table view and a UISearchbar on it. The searchbar delegate methods are in the view controller for the UIView. Everything appears to be hooked up correctly.
This searchbar works correctly in iOS 5, but not in iOS6. When touched, the searchbar brings up the keyboard, but typing on the keyboard has no affect; the textDidChange delegate method is never called.
This occurs only when running on an iPad. The difference between the view on an iPad versus the iPhone is that the UIView with the UITableView and UISearchbar runs in a popover on the iPad. On an iPhone, it runs as a separate view. In both cases, once the view is opened, a UINavigationController manages the view. All the navigation up and down the nav controller works fine in both devices; the only difference is that the UISearchBar does not work running in the popover.
Obviously, something has changed between iOS 5 and iOS 6, but I haven't been able to figure out what, or how to make the searchbar work in an iOS 6 popover.
Any help will be greatly appreciated!
rokjarc is right. I have same problem. In my app'SearchBar Display Controller, SearchBar is not respond to keypad typing in ios6. But it is fine in ios5 simulater, ios6 simulater, iPhone 3GS, iPhone 4.
In MainWindow.xib,
1. Click "Window" icon in "objects" Box.
2. Show Attribute inspector
3. Expend window attribute.
4. Check "Visible at Launch" and "Full Screen at Launch"
5. Clean build and run.
6. Good. OK?
I just got the answer on my original problem. I discovered that the same thing was occurring in UITextFields and UITextViews. I sent the whole thing off to Apple Tech Support.
Turns out that you have to include this line of code:
[self.window makeKeyAndVisible];
in the application's delegate's didFinishLaunchingWithOptions: method. When I added this line, the problems went away.
Hope this helps.