• Home
  • Über mich
  • Impressum

Marc Schlüpmann

My personal View of the World

Programming

UIAStepper missing in iOS

18. September 2015 by Marc Schlüpmann Leave a Comment

If you want to automate your user interface for testing or to take screenshots using fastlane you can use Apple’s UI Automation framework. Every element from UIKIt has a corresponding class in UI Automation – every? No, not every element.

The UIStepper class does not has a corresponding UIAStepper class in the testing framework, but it would be nice to automate it, too. If you record your activities on the UI with Instruments you will get something like this:

target.frontMostApp().mainWindow().tableViews()[0].tapWithOptions({tapOffset:{x:0.37, y:0.47}});

If you want to create this not using Instruments it becomes tricky. Even if you try to use the accessibility labels you will fail. By the way: The UIStepper does not has accessibility properties in Interface Builder.

So, what’s the solution?

If you look at the array that is returned by calling elements() on the parent element you will find two UIAButton entries. One with the name „Increment“ and one with the name „Decrement“ – and these two can be used to automate UIStepper actions!

To simulate a tap on the ‚+‘ button on a UIStepper you can simply write:

window.tableViews()[0].cells()[4].elements()["Increment"].tap()

and

window.tableViews()[0].cells()[4].elements()["Decrement"].tap()

to simulate a tap on the ‚-‚ button respectively.

But there is a small snare: The names of the elements are localized! So you have to check for your localization and use the correct strings. For German the strings are ‚Erhöhen‘ and ‚Verringern‘.

It’s that easy, but not documented by Apple. Have fun!

Posted in: iOS Programming Tagged: iOS, Programming, UI Testing, Xcode

Xcode 5 Crashkurs

18. Dezember 2013 by Marc Schlüpmann Leave a Comment

Kurz vor Jahresende war ich noch einmal im schönen Graz und habe für video2brain ein weiteres Videotraining aufgezeichnet: Der Xcode 5 Crashkurs.

In diesem Training geht es um die Nutzung von Xcode 5 und wie man als Programmierer Apple’s Integrierte Entwicklungsumgebung am besten nutzt. Hierbei sollen sowohl Einsteiger als auch bereits erfahrenere Nutzer einbezogen werden. Das Spektrum des Videotrainings umfasst die Installation, erste Schritte, eine Erläuterung der Oberfläche und geht hin bis zur Nutzung von Xcode Server.

1327

Posted in: iOS Programming, OS X Programming, Work Tagged: iOS, OS X, Programming, Videotraining, Xcode

Xcode 4.3 crashes on Archive

1. März 2012 by Marc Schlüpmann Leave a Comment

The Situation

I have an Xcode project for an iOS app with 10 targets creating different variants of the app. I was able to archive all except one of the targets. On building an archive of this target Xcode crashed with

(NSInvalidArgumentException): -[DVTFilePath compare:]: unrecognized selector sent to instance 0x406368fe0

The build and linking worked properly and the activity viewer showed ‚Archive success‘ shortly.

In the good case after this step the Organizer opens and shows the generated archive. If there is an error during archive Xcode shows this in the standard issue navigator and in the activity viewer – but you know this. In my case Xcode crashed with the error mentioned above.

I had no problems earlier and was a little bit surprised as this error was 100% reproducible.

The Analysis

The typical first step is to look for someone else having the same problem. It showed out that there were some developers with the same problem. I stepped over Ash Furrows blog entry on this topic: growl notification code signing for sandboxed mac apps

Ash describes the same crash by using the Growl.framework in one of his projects in correlation with code signing. I did not use that framework in my project, but remembered that I included the Facebook iOS SDK. This one was built locally from the sources and the static library is inside my Xcode project. As the app does not use Facebook features currently the static library is not used in any target – it is just in the project. But in contrast to Ash’s problem with the Growl.framewok mine was a little bit different: I did not used a binary version of the static library, but it was already compiled on my own. So, what’s the problem?

The Solution

After removing the library from my project everything worked fine. So the crash must be related to the static library. I added it to the project again, but not to any target and boom – Xcode crashes. After that I found the helpful words in Ash’s blog entry: „You’ll need to rebuild Growl.framework any time your certificate expires, once a year.“

I remembered that I had to renew my certificate a few days ago. And indeed this is the solution! If you have another framework or static library in your Xcode project (even if not used!) you have to recompile that every time your developer certificate changes – usually once a year. If you miss that Xcode 4.3 ends up in a crash if you create an archive.

This is a really bad behavior of a piece of software to react with a crash on some kind of reconfiguration. Apple should fix this annoying and not even easy to handle bug. In the case of Ash and myself we were able to recompile the code as the sources are available to the public.

Posted in: iOS Programming Tagged: iOS, Programming, Xcode

What’s hot

Ammersee Denkerhaus Atmen Breitband Bürgerbeteiligung Chart Cordova Coworking currant Diagramm Dießen El Capitan Finanzen Gemeinderat Geschmack Gesundheit Grüne Huber Häuser Internetzugang iOS iOS 6 Jugend Jugendtreff Kommunalwahl MTV Dießen Mühlstraße Nasendusche Netzdiagramm Neues Jahr Obermühlhausen Oenologie OS X Parken Parkplätze Phonegap Politik Programmierung Programming Radar Diagramm Transparenz Untermüllerplatz Videotraining Weihnachten Wein Weinbau Xcode

Kategorien

  • Allgemein
  • Ammersee Denkerhaus
  • Datenschutz
  • Dießen am Ammersee
  • Gemeinderat
  • iOS Programming
  • OS X Programming
  • Podcasts
  • Politik
  • Privat
  • Work

Neueste Kommentare

  • Michael Hofmann bei Bürgerbegehren gestartet
  • Frank Fastl bei Bürgerbegehren gestartet
  • Michael Hofmann bei Bürgerbegehren gestartet
  • Leopold Ploner bei Parken auf dem schönsten Platz von Dießen
  • Leopold Ploner bei Über den Dächern von Dießen

Lesezeichen

  • #Schondorf
  • Ammersee Denkerhaus
  • Ammersee Kurier
  • Annes Art
  • Annes Topfgeflüster
  • Chaos Computer Club
  • Logbuch:Netzpolitik
  • Margarete Bause
  • Obacht! – Reloaded –
  • Petra Sander
  • Renate Standfest
  • Sitzungstermine Dießen

Archive

  • April 2020
  • Februar 2020
  • Januar 2020
  • September 2017
  • Juli 2017
  • Juni 2017
  • Mai 2017
  • März 2017
  • Oktober 2015
  • September 2015
  • Juli 2015
  • April 2015
  • März 2015
  • Januar 2015
  • Oktober 2014
  • Februar 2014
  • Januar 2014
  • Dezember 2013
  • Juni 2013
  • Januar 2013
  • Dezember 2012
  • Mai 2012
  • April 2012
  • März 2012
  • Februar 2012
  • Dezember 2011

Copyright © 2025 Marc Schlüpmann.

Omega WordPress Theme by ThemeHall