Button works in simulator for not in App - iphone

I have a few different views in my App, all of which are viewed by tapping different buttons. All the buttons work on the simulator, but when I run the app on the device only one button does not work. I went over and over my code and re coded that one button and re-connected it in IB to make sure that i did not mess something dumb up, but it still freezes my app.
When the bad button is tapped the App will freeze but not shut off and the only way to unfreeze it is to press the home button.
Any thoughts on why this might be happing only to this one button?

I got it! It was something really dumb! In the view that is loaded when the button is tapped there is a picker. What was happening is that I have a BOOL value that needs to be set to true when the button is tapped and I forgot to set it. Without that BOOL value being set the picker was not being loaded the right way.

Related

EXC_BAD_ACCESS Error in gelRunVertexSubmitARM

In my project I am using a storyboard.
There is view controller MyViewController. MyViewController has button, on click of button it opens a Isgl3DViewController.
Isgl3dViewController has an animated 3d object. Isgl3dViewController also has a Close button, which dismisses the Isgl3dViewController and moves to MyViewController.
Now, when I am doing this first time, everything is working fine. I am able to see animated object and able to move MyViewController on click of Close Button.
But second time, when I click on MyViewController's button to display animation, Application being crashed again and again.
When it's working fine in first time then why app crashes in second time? Please help me out this.
For Reference I am attaching screenshot.
had the same problem, in my case because i add UI elements over the isgl3dview.
my workaround was substitute the UIView by a HUD.

UINavigationButton & UIButton on PopToRootViewController?

My app has a sign in button and a sign up button, which are UINavigationButtons and UIButtons respectively. Either segues to a new screen that, on success, should PopToRootViewController; However, when I successfully sign in, my sign in and sign up buttons are still present. I have a method that decides whether or not to display the buttons that gets called in the viewDidLoad method. Thus, when I stop/run the app again, the buttons disappear as they should. Can anyone give me advise on how to get these buttons to hide? Thank you.
Bonus points: I also have a log out button that has a similar issue; I have to re-run the app before my view controller realizes it should hide the logout button and show the sign in/up buttons.
The problem is that viewDidLoad is only called once, so it is hardly suitable for this purpose; it has to do with the view coming into existence, and nothing to do with the interface. Use viewWillAppear: and make the decision about whether to show or hide the buttons on the basis of, say some info you've stored in NSUserDefaults (like, has the user signed in or not).

UITabBar ignoring occasional "clicks"

I'm working on an iPhone app that has a UITabBar. Occasionally the tab bar ignores my "clicks" (or "taps", or whatever they're called in the iPhone world). It happens on both the simulator and the on the device. Clicking on a tab bar button won't result in any action, and I have to click it several times for the expected action to occur.
Can anybody shed any light on what might be causing this issue, or how I can go about debugging it?
I read somewhere that the UITabBar becomes unresponsive when it is not the immediate child of the window. It can be something like that or you might have a UIScrollView or some other view interfering with your UITabBar.
P.S
Click is correct for buttons, including tabs. For others, a widely used term is touch.
This might be happening bcoz the view is not getting loaded when you click on the tab.
Are you using any url request in the -(void)viewDidLoad method. If this is the case may be ur internet is workin slowly.

How can we disable the button in my iphone app?

In my application, there is one button in the navigation bar. I want it to work only for the 1t click of the user. If he continousally presses on it 2 or 3 times just after the 1st click the button shouldnt recieve the following ones. How can I do this?
My app always crashes if the user presses it for more than once. I dont want to make it multithread and use lock. Thats why i want to know whether there is anyother alternative.
(If the app crashes by pressing more than once then there's a bigger problem.)
Since the button is on the navigation bar, that's a UIBarButtonItem, not a UIButton. The UIBarButtonItem has an enabled property which you can set to NO to disable the button.
(If it is really a UIButton, don't worry, it also has an enabled property.)
After the user clicked the button, you could set the "enabled" property to NO and after the action finished, set it back to YES
http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIControl_Class/Reference/Reference.html#//apple_ref/occ/instp/UIControl/enabled
Luckily this is pretty easy to do. The UIBarItem class has an enabled property. Just set it to NO once the user taps it.

iphone app Enter screen

I'm in the process of making an app that has a UITabBar at the bottom of it. I want to make an "Enter screen." Basically, when the app starts up, right now the enter screen appears, but the tab bar still shows at the bottom. So if the user presses a tab on the tabbar..and then goes back to the first screen, the enter button is still there. Anybody know a good way around this? I was gonna try to have it so that if the user selected another tab, the enter screen would just go away. Either that or just to have a full screen view over everything and then when enter is pressed, have it close to full screen view. Although, I don't really know how to go about doing either of those. Any ideas?
Chris
You can use the method -viewWillAppear on your UIViewController subclass to hide your enter screen. It is called every time a tab is selected, on the new tab, just before it is displayed.
If I understand correctly... you just want a title screen when your app starts up that never shows again during that session?
If so, just create a file that is a 320x480 image of what you want the screen to look like... save it as a PNG, and name it Default.png.
This image will be shown while your app is loading, and then will disappear when your app is ready to go. No tab bar will show, and you won't need to mess with disposing of any extra ViewControllers.