Cannot tap a table cell in Xcode UI testing - tableview

I am writing Xcode UI test cases for a tableview. My code (Objective-C) is something like this
XCUIElement *elementCell = app.cells[#"AccessibilityIdentifierOfTheCell"];
XCTAssertTrue(elementCell.exists); // this assert passed
[elementCell tap]; // !!!??? crashed here
The testing crashes at the "tap" method.
I also tried Xcode's "Recode UI Test" to see how Xcode would catch the "tapping" behaviour in UI testing but, unfortunately, when I tapped on the cell the testing crashed as well and Xcode popped up this:
I got stuck here for quite a while and it will be highly appreciated if anyone can help me out.

Right after the question was posted I went back and tried again and, weirdly, it worked. I changed nothing. It may be that Xcode UI testing functionality is not steady yet.
Sorry for that.

Related

Weird NSOutlineView crash

I'm experiencing weird crash in NSOutlineView: when i click "collapse" button, app crashes immediately and even "exception breakpoint" doesn't help to see where the problem is.
I've tried to run app without debugger, and reproduced the problem. Once app crashed, i've got OSX crash window and was able to extract crash message from there:
The window has been marked as needing another Update Constraints in Window pass, but it has already had more Update Constraints in Window passes than there are views in the window
there also call stack, but it won't help since crash happening inside libsystem_c.dylib, so i'm not posting it here.
It seems there is something wrong going with auto layout. Absolutely have no idea about next steps. Please give me an advice!
Also, one more thing, that began only after update to OSX Mojave.
After hours of debugging and testing, i noticed that that message is caused by "infinite layout loop".
Different code, related to outline view was causing NSSplitView to layout. And delegate method - (CGFloat) splitView:(NSSplitView*)sender constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex has been called about 200 times prior to crash.
It's hard to catch this bcs it's not actually infinite recursion, so just debugger doesnt help a lot.
I just added simple code that helped me to identify the issue:
static int a = 0;
NSLog(#"Layout: %d", a++);
Hope my experience will help somebody else!
For anyone who is having the problem in Xcode 14 and macOS using SwiftUI:
I just had the same crash by hiding a view with an animation. My main view contains two views, one view contained an empty ScrollView, which didn't cause a problem by itself, but by changing it's size it crashed. Just adding a basic Text within the ScrollView solved my problem and the app doesn't crash anymore.
I updated my build to IOS 14 and Mac OS 20.15.6 and the error went away.
try turning off 'Use Auto Layout' checkbox in nib (in File Inspector tab).
May have to disable it for each and every view.
Also, unrelated, but Mojave forces you to use Core Animation.
Most of my nibs have 'set wants layer' turned off.
However, in one of my nibs I had a stray setWantsLayer checkbox checked.
when I unchecked it, the view (NSSearchField) drew properly

Why Xcode doesn't show descriptions in "Quick Help"?

I'm working on a project and suddenly Xcode (Version 9.1 (9B55)) stopped showing the descriptions of classes, methods etc. in a Quick Help. I can see the same behaviour when I option-click on the classes and methods. Here how it looks, for example, when I tap on a viewDidLoad() method:
However, when I open another project, it works fine. Here is a screenshot from another project, when I tap on a viewDidLoad() method:
So, I think, this isn't an issue related to Xcode itself (or I'm wrong), but maybe I have accidentally broken something in my project. Anyway, I can't figure out what can cause this issue. Do you have any ideas?

kendo ui back button breaks my app navigation

I have tried to get the data-role="backbutton" kendo mobile ui feature to work but I am having issues. When testing the app on my iPhone 4 I get stuck in my app because the back button breaks the UX.
What happens is that when I am testing, I click heaps of back buttons (as they are used quite heavily in my app) and then randomly one decides to slide the previous view into the screen but only goes halfway and then snaps back (or some other type of visual glitch occurs). Then after that, all my navigation breaks down and I get stuck in the last view that I was in. Or better yet the links go to places that they are not supposed to. My tab bar does not work and either do links in the header. I have to exit the app completely, remove it from operating and try again. Seriously something wrong going on here.
I have tried to programatically add the back button by following the Kendo UI documentation but that does not work either. I am left with a button that does absolutely nothing when clicked - it may not even solve the issue anyway. I have looked using developer console in Google Chrome but I can't see any obvious issues.
Has anyone using Kendo Mobile UI experienced this issue before?
I downloaded the latest release of the Kendo UI build and the problem seems to have been resolved. Surprising! I assumed the Kendo framework was a bit more mature to be experiencing such a big issue. It was occurring when using slide transitions in navigation. Here is a link to the bug post on Github https://github.com/telerik/kendo-ui-core/issues/66

Tabbed application troubles in xcode

I am working with my first tabbed application in xcode. I am just testing with some stuff since I'm relatively new to programming. I am just using the 2 views already put into the template. I am putting a slider into the first view and am going to attach it to a text box with numbers. But that isn't the problem! This is probably really stupid and simple, but when i run the application just to see the stuff on the simulator, it is just showing a black screen. NO CLUE WHY! But its killing me and would love some help!
You are not suppose to make connections in AppDelegate. You should use a ViewController for each class. I.E. FirstViewController, SecondViewController. AppDelegate is usually only used for calling save/restore messages.
You are getting the error because the storyboard view is assuming you are assigning it to the correct view. When you create the storyboard say you named it TestApp. Then, you should have a few classes. TestAppDelegate, TestAppDelegateFirstViewController, TestAppDelegateSecondViewController. Or something along those lines. FirstViewController should connect to the first view on the tab view. The Second should attach to the second.
AppDelegate is almost never used for UI. I would suggest you find a book on the matter. I'll suggest "iOS Programming. The Big Nerd Ranch Guide". It helped me a lot when I started.
Photo Exmaple:
I did end up starting a new project. Weird that the black screen showed up.. not really sure why that error was popping up.. I'm not really that knowledgable about the different errors and bugs that a program can have yet! Getting closer though!

Strange bug in cocos2d-x

I have found one bug that causes the cocos2d view to stop rendering its contents. The bug can be reproduced using the example project found in Jpsarda's post about integration between UIKit and cocos2d-x.
The link to the website is: http://jpsarda.tumblr.com/post/24983791554/mixing-cocos2d-x-uikit and the link to the project is: http://dl.dropbox.com/u/12856650/Cocos2dxOnUikit.zip.
To reproduce the bug it is sufficient to trigger several times between uikit views and cocos2d views by pressing repeatedly the "Cocos2d-x GO!" button on the first view followed by the "Close" button on the second view. I have also done a video that shows how to reproduce the bug: http://youtu.be/EIvf-Ao6u5I. The bug occurs only on a real device and not on the simulator. Because of this bug it is pretty difficult to create applications that allow the user to switch frequently between cocos2d views and uikit views such the one on which I am working. For the moment I can't understand the root cause and I haven't received a reply on the forum yet. Is there anyone that have an idea/intution/suggestion about the possible cause?
I found the reason. EAGLView is never released and this causes a leak of resources. To resolve the bug in JPSARDA's example it is sufficient to add the following line:
[[EAGLView sharedEGLView] release];
at the end of CCEGELView::release method. This will solve JPSARDA's ( and my application :D ) issues but it is likely that this solution won't work in projects that handle EAGLView's lifecycle in a different way

Resources