Buttons working in ios6 stopped working in ios5 - objective-c

I load two buttons in one view from the NIB.
I set this view as self.navigationItem.rightBarButtonItem in current viewController
I set actions for these buttons
Result:
Buttons work under ios6 - both simulator and device and not working on ios5 device.
Any idea to fix it?

I fixed it by set "Autosizing" in "Size inspector".
(in my case, the problem came from resize iPhone5 to iPhone4)

The problem is now solved. This was caused by setting UIViews objects in IB and then setting its class to UIButton. It should have no effect on buttons behaviour, but it had. The more wired was that it did work on iOS 6 and did not in iOS 5.

Related

iOS8 Set Popover Size In Storyboard

I'm trying to set the popover size of a view controller through the storyboard in iOS8. It should be noted that I'm using Obj-C, not swift, and Xcode6-Beta6.
I read the new documentation on popovers from Apple, and this post here was helpful:
How to present popover properly in iOS 8
When I set the preferredContentSize of the view controller in code before presentation, it works fine and is the correct size. However, when I try to use the storyboard properties, "Popover:Use Explicit Size" and "Simulated Size:Freeform", they don't seem to affect the size of the popover like they did in iOS7 and earlier.
Is there any way to set the size of the popover through the storyboard in iOS8?
Thank you for your time
This seems to be a bug in the Xcode6 Beta; I just got the Xcode6 GM version and all the popovers are the correct size.

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.

Application Lauch in Landscape mode while Simulator/Device is in Portrait mode in ios6

My application window has UITabBarController as a RootViewController. Then UINavigationController as TabBarController's RootViewController. Then another HomeViewController as NavigationController's RootViewController.
When I launch my application in Portrait mode, then HomeViewController's UIView outlets displayed in Landscape mode. All UIView outlets have Landscape mode coordinate. Because return Orientation is Landscape.
I found many Q&A, Blogs. I applied whatever other developers said, but not succeed.
This issue occurs only in ios6 device/iPhone simulator 6.
Right now I am working on Simulator and its show this issue.
Please help me as soon as possible.
Ask me, if I am not capable to explain my question.
Thank you in advance.
In iOS 6, the app looks at your predefined possible orientations from your project file. Check if that only lists landscape, also it uses the shouldAutoRotate method, so you might have to implement that as well.
Check this for more info:
Similar question

Creating universal app trying to implemenet shouldAutorotateToInterfaceOrientation

I created a single view universal app, and made sure that the method shouldAutorotateToInterfaceOrientation has been implemented in my ViewController.m, well when I launch the simulator and rotate the device it doesnt do anything when I rotate. I have verified that in my plist all 4 orientations are added, all four of the buttons are selected. I havent added any other controllers to the view and it doesnt work what am I missing? It rotates just fine in when running the iPhone version. I am using storyboards here, so I have an iPhone and iPad storyboard. I even added a breakpoint to that method and it is never called.
iPad and iPhone use different setting. Are you sure you selected all four orientations for iPad?
Please double check "iPad Deployment Info" in your targets setting - Summary tab.

UIScrollView not functioning correctly after Modal view controller displayed in iOS 5.1

I have a strange problem when using a UIScrollView controller combined with iPhone 4 and iOS 5.1.
I have a UIScrollView which has a content size of 640x480 (double screen effectively) and in addition to the swipe to switch between the two "screens" I also permit the user to tap the screen in response to which I call something like...
[scrollView scrollRectToVisible:(CGRectMake 320,0,320,480) animated:YES];
the first 320 would be 0 if the tap occurred whilst the right hand side of the scroll view was displayed (note the scroll view has paging enabled so it can only come to rest either fully left or fully right).
I also have a situation where I sometimes display an additional view controller modally using presentModalViewController over this view controller containing the scroll view.
Everything works perfectly until the modal view controller is presented and subsequently dismissed after which the scrollRectToVisible method will no longer work if animated is set to YES (if I change animated to NO then it works as expected). Note, the tap is still being registered and the scrollRectToVisible being called, it just doesn't do anything when animated is set to YES).
Here's the kicker, this bug only occurs on an iPhone 4 runnings iOS 5.x.
It works perfectly (even after the modal view controller has been displayed) on my:
iPhone 3G running 4.x,
iPhone 3GS running 3.x,
iPod touch (2nd Gen) running 4.x
and most surprisingly the simulator running 5.x.
I wondered if this was a bug in the animation system so disabled the animation on the modal view controller presentation and dismiss and this had no effect, problem still occurred on the iPhone 4 with iOS 5.1.
Anyone got any ideas as to what might be causing this and how I might work around it?
Finally tracked this down. what a pig...
I'm embedding a view from a view controller as a subview of another view controllers view. So my scroll view contains a view which also has an associated view controller.
Prior to iOS 5.x the methods viewWillAppear, viewWillDisappear, viewDidAppear and viewWillDisappear are never called on the sub views view controllers, only the main view controller. Already knowing this I set up my main view controller to manually call the sub views view controllers methods when these events happen.
However it appears that in iOS 5.x this issue has been "fixed" so where I was manually passing the call to viewWillAppear to my sub view controller I no longer need do this under 5.x as the method automatically gets called under 5.x - as a result it's now being called twice under 5.x but still only once when running on a 4.x or earlier device.
As a result, under 5.x my NSTimer used to call my updateUI method is being created twice, but because in viewDidDisappear I only destroy the timer if it is non nil it only gets destroyed once - therefore I'm leaking NSTimers under 5.x through double allocation where I'm not under 4.x.
As a result of multiple NSTimers hanging around all repeatedly calling my updateUI method is that the constant updating of the UI is killing the animation system and so the animation for the scrollView fails when running on an actual device. I guess it continued working OK on the simulator running 5.x as the CPU in the Mac is more than capable of handling the extra workload and still performing the animations correctly.
A simple check in my viewWillAppear method to ensure the NSTimer hasn't already been created has fixed the problem and has kept compatibility with 4.x and earlier.
I frustratingly run up against these kinds of issues every time Apple update their iOS by major versions... The morale of this story is don't assume that long standing classes still exhibit the same behaviour under different revisions of the OS.
I had the same problem. I realized that after modalViewController is dismissed my UIScrollerView shifts downs by 20px, which is the same height as status bar. So, it means when my UIViewController is loaded and UIScrollView is created, UIScrollView thinks there is no status bar, when actually it is there.
So I tried to put in viewDidLoad:
[[UIApplication sharedApplication] setStatusBarHidden:NO];
Now my UIScrollView always stays under status bar, with Y position 20px. It never shifts down.
I finally managed to get this working on an iPhone4 running 5.1. Ensuring the bounces horizontally property for the scroll view is set fixed the problem, though why having this unchecked should cause the problem in the first place is beyond me - I'm pretty certain this is a bug in iOS.