I have implemented UIPopOver in my class to display certain options, in simulator it is working properly but in device it is disappearing even if I do not click on any other area.Can anyone know why popover is behaving weirdly in device?And how I can overcome this?
Thanks in advance!
Please provide the code you use to display your controller. A wild guess would be that your controller is not retained correctly and may be released or its parent controller is being released.
You should also check that you simulator is running the same ios version as your device.
Can't help more without more details.
Related
I have created two UIViewControllers in IB.
PROBLEM 1: I can't make the 2. VC transparent.
I have read a lot of stackOverFlow solutions but nothing seems to work in my case.
I have tried the following setup in IB both in my current project and in this simple project and something strange occurs (IB,for 2.VC):
Setting the alpha value below 0,5
Setting opaque to "checked"
Setting the background color to "black"
https://imageshack.com/i/kqdXWk9Jp
The second VC gets pushed when I click "GO TO NEXT VC" (push or modally , doesn't matter) and while he is being pushed I see the the result I want:
https://imageshack.com/i/idXUCFCPp
... and when the push is finished the new VC changes from being transparent to black (not transparent):
https://imageshack.com/i/iqmLw8D1p
I have no clue why this is happening and I cant get it to stop working like that.
Q1: Why is this happening?
Q2: Why can't I change the properties of the views programmatically when the views are created with IB?
I have done this thousand times WITHOUT using IB. As soon as I start using IB things don't work like they are supposed especially when I try to edit stuff programmatically.
When I do all of these steps without IB only in code everything works perfectly fine but I need to use the IB in my next project. I am using Xcode 5.1.1. on mac mini (late 2009) with Mavericks.
Sorry for bad English.
Your problem is because the memory management of iOS removes the previous interface ViewController, to save resources.
After iOS7, you can customize the transition viewControllers. Please read: UIViewControllerAnimatedTransitioning Protocol Reference.
I also had the same problem and managed to solve it by following the tutorial Custom UIViewController Transitions.
If you are still having doubts, there is another tutorial to help you: iOS7: Custom Transitions.
Hope you get success!
I found that a previously normally working iPad storyboard started working weirdly upon introducing auto-layout. In particular it seems not to properly show different ViewControllers when clicking different annotations but instead it always shows the first one whatever more annotations are clicked. When I disable auto-layout everything works fine again. Apple responded to my request hinting to a problem in the handling of segues:
#Apple: 'When running a segue from A -> B, it is not our intention that that segue over and over again will result in a chain like A -> B -> C -> D because the original transition is A -> B. However it would make sense if you had a self-referencing segue and you called performSegueWithIdentifier over and over again because you in that case are having the same instance just added to itself. I think you were just getting lucky before and that turning auto layout on was just enough to point that out.'
Yet all the hits I found on the web like in:
How to call a segue from a disclosure button on a map pin?
and
MKMapView show DetailView - How to make a segue
are quite the same as the the code I used and Apple says it is wrong; notwithstanding the iPhone version keeps on working and the problem just arises on the iPad.
Any hint before they crank up another funny suggestion?
Unfortunately the problem, the way it went the way it returned. Eschewing the possibility I ran mad, the same code including the one on the iTunes Store now, started presenting the problem again. I also tested it on another iPad and it presents the same problem leaving me totally in the dark. All the thing seems crazy.
After a number of tests I found that a normal working iPad storyboard starts working weirdly upon introducing auto-layout. In particular it seems not to properly pop-up dismissed views by always recycling the same view controller and to also badly handle the queue of instantiated view controllers. When I disable auto-layout everything works fine again. Does anyone know if this bug is known to Apple or there is a fix?
Not been able to complement the question with new information, I posted a new one at:
Triggering segues from annotations
My iPhone application has just suddenly changed behavior and I have no idea why. I have a small button and it is now only firing on touch up outside and not touch up inside. I'm not aware of anything I changed that may have caused this.
As you can see from the image below, it is correctly wired for touch up inside to the onAdd selector.
Any ideas on what could cause this behavior?
Check GestureRecognizers, other IBActions in this view. Try to link up event with touchUpOutside and check is it working ok, then revert to Inside and check behaviour. Use NSLog in methods to see what's firing on tap. Without sample code I can't say much more.
I am a learning developer that is always trying to learn new things. I am playing around with more advanced views and subviews, and am currently trying to use a view within a view. I know how to use modal views, but in this case I want both views to be present and running. So, picture the iPad running an unscaled iPhone app, that is basically the same idea of what I am trying to do. I can get the view to load up just fine, however, when I use buttons or anything inside the views that the user interacts with, the application crashes. It gives the following error message: EXC_BAD_ACCESS (Code=2, Address=0x17). What's weird is that there is no output from the debugger on this issue. I have tried to use a delegate (the way you do in a modal view) and it doesn't change anything. Any help is much appreciated :)
You can, of course, put many views inside a view.
EXC_BAD_ACCESS means you, or some object, is trying to access an object which has been deallocated.
I can mostly promise you that the issue is not because you are putting a view in a view, that statement and actually doing that is fine.
How you go about doing it, and how you handle everything is a different story.
You didn't provide any code or context as to where and how you are adding a view to a view, which is probably where the issue is arising. Enabling NSZombie as suggested by xlc0212 is a great idea to help diagnose the problem.
Hope this helps