How to scroll the gdb window within cgdb? - cgdb

While using cgdb, how does one scroll through the output visible in the gdb window?

PgUp and PgDn should scroll the gdb window. If they don't, check your TERM environment variable and make sure it's set correctly.

Related

How do I keep newly added UIWindow on top

There are requirements in my application wherein I need to add the new window for few additional functionalities and I am able to do that successfully. After launching the application I am adding and dismissing windows as per the requirement. But I want to know that how do I keep my current window always on top of other windows if any to avoid conflicts? Are there any ways in iOS where we can keep the presenting window always on top of other ones?
Take a look at makeKeyAndVisible API
func makeKeyAndVisible()
Shows the window and makes it the key window.
This is a convenience method to show the current window and position it in front of all other windows at the same level or lower. If you only want to show the window, change its isHidden property to false.
Also, UIApplication has .windows property, which is an array of visible and hidden windows
var windows: [UIWindow]
You can iterate this array and find a window which you are gonna to set as a key window.
And lastly take a look at .windowLevel UIWindow property, it manages position of the window in the z-axis.
var windowLevel: UIWindow.Level { get set }
Window levels provide a relative grouping of windows along the z-axis. All windows assigned to the same window level appear in front of (or behind) all windows assigned to a different window level. The ordering of windows within a given window level is not guaranteed.
The default value of this property is normal. For a list of other possible window levels, see UIWindow.Level.
The ordering of windows is controlled by UIWindow.windowLevel.
myWindow.windowLevel = .statusBar + 1

iOS accessibility doesn't recognize anything on the screen

I'm trying to make my app accessible (use voice-over properly).
It works just fine in the first screen (login), but after the login no element gets the accessibility focus. It seems to be stuck.
Accessibility inspector's audit gives me this issue for all of the "should-be-accessible" elements in the screen:
This element appears to display text that should be represented using the accessibility API
When pressing the question mark I get:
Determine if any part of the content should be exposed as separate accessibility children
Does anybody have an idea? Did you get this warning?
P.S.
Apologize in advance, but I can't share my code because of security reasons.
Solved my problem.
Apparently, i've added another view after the login and then animated it off screen, but did not remove from superview.
It caused the app to lose accessibility focus (the focus was on the status bar only).
After removing the view, my app got the accessibility focus again.
My lesson from this problem - remove unnecessary views!
P.S
It's legacy code - wasn't written by me :)
You can follow three things :
You can all the view hierarchy and check whether accessibilityElements are properly set or not.
Unnecessary views isAccessibilityElement property should be set as false.
remove Unnecessary views.

Unable to change the view size in XIB?

I am trying to make the view controller as size as 300x400, i have done following things,
Open the XIB and go to the Size inspector
Changed the width and height properties to 250 and 300
Saved the file and closed interface builder
But its Not working ??
Just double check with your code whether anywhere frame assign programmatically. If NO, just do following step.
1) Clean and build -> Run. If not work, go to second step.
2) Delete app on simulator and run again.
Right click on XIB
Choose open As
chose source code
and change width and height ..
First of all its important to know that how you are checking size is changed or not.
If you are doing addSubview of this resized xib into other view controller than you feel the change in xib. But in case you are using Push view controller than you will not feel the change. Because view controller will show over the window so you can not change the window size.
Note :
If you want to show the resized view as an subview in any other page than you need to take subview in that view & make add subview of the current view.
Hiii #Gautam, this can be possible, you can do the following things,
Clean your project because sometimes it will not recompiled. Run it again. If this not work then you can use 2nd way
Open the source code of filename.xib by using right clicking that xib and perform change to height and width.
Hope this will work for you...
Thank you...

How does UIAutomation determine whether a UIAElement.isVisible()

I have a view with the following structure:
GrandView
-Parent View1
-Parent View2
--Child View1
--Child View2
The child views take up almost all of the bounds of Parent View2, but there is still some space around the edges. I can select Parent View2 in the simulator with the accessibility inspector if I click on the edges. I can also tap Parent View2 in UIAutomation if I use:
tapWithOptions({tapOffset:{x:0.15, y:0.95}});
However, my calls to isVisible() always return 0. I expect that if I can tap the element, or select it with the accessibility inspector, it should return 1.
How does UIAutomation determine whether a UIAElement is visible?
Every operation you perform against an element has a timeout. This isn't obvious from the Apple documentation, but if you look at: setTimeout , it tells us:
The timeout value establishes a grace period for object resolution. If an object representing a UI element becomes available within the grace period, an attempt is made to instantiate that object from information retained by the instrument.
setTimeout itself just changes the default value (as do push and pop). What you really want to do is perform your action on your view, and fail on the timeout if it never becomes available (the default timeout is 5 seconds). The WWDC 2010 session "Automating User Interface Testing with Instruments" does go into this a little, it's available on the ADC WWDC 2010 page, with both video and slides. In your case, you'd want to execute the tap() on your view. If, for some reason, that view isn't available to UIAutomation within 5 seconds, you should see an exception. Experiment with changing the timeout by doing:
var oldTimeout = target.timeout();
target.pushTimeout(10);
before your code, and
target.popTimeout(oldTimeout);
after.
If it's a UIView, it should be driven the the hidden property. If it's not a view, and it's a container, it should be driven by accessibilityElementsHidden .
In general though, you don't want to use this for UIAutomation. Instead, whatever you were going to do on the view - in this case, a tap() - go ahead and do it, and let the system throw an error if it times out. In general this is the model you want to follow in your scripts rather than testing whether something is available first. Sine UIAutomation is DOM scripting the UIAccessibility information, when things like animated view transitions happen things get out of sync. Sometimes the script executes faster than the UI animates, and sometimes the opposite! waitForInvalid may be a shortcut to a solution for you.
Alex Vollmer's tuneup.js library for UIAutomation makes writing tests much easier, and is easy to extend.
https://github.com/alexvollmer/tuneup_js

Where is the frame property in debug view of a UIView?

I see other properties of an object (subview array, gesture recognizers, tag, etc.) in the debug area when I add a breakpoint, but can't find the "frame". New to using breakpoints and debug features, can't figure this out. Just want to be able to examine the frame of a UIView at a breakpoint. Thanks.
The debugger's variables pane doesn't show everything, unfortunately. The easiest way to print out the frame is to NSLog the view itself. UIView's description method prints the frame values as part of the NSLog message.
If you don't want to put an NSLog in, when you hit the breakpoint you can also do po nameOfView in the gdb console. That's the same as NSLogging it or calling -description.

Resources