• Home
  • Über mich
  • Impressum

Marc Schlüpmann

My personal View of the World

iOS 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

Notes & Coins

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

Der Informatik-Unterricht in der Schule ist ja bekanntermassen eher abstrakt und behandelt Themen, die eigentlich eher in eine Microsoft Produkt-Schulung gehören. Da meine Stieftochter nun gerne einmal genau wissen wollte, wie man so ein Programm schreibt, haben wir uns ein kleines reales Projekt überlegt und dies in Form einer iOS App umgesetzt. Gesetztes Ziel war es, dass die fertige App dann auch im App-Store von Apple veröffentlicht wird.

Die uns gesetzte Aufgabe war die Entwicklung einer App zum Zählen von Geldbeständen, so dass man durch Eingabe der Anzahl einzelner Scheine und Münzen den Gesamtbetrag angezeigt bekommt. Herausgekommen ist die App Notes & Coins.

Notes & Coins

 

Posted in: iOS Programming, Privat Tagged: iOS, Programmierung

Running Xcode 6.4 under El Capitan

10. Juli 2015 by Marc Schlüpmann Leave a Comment

If you plan to update your Mac to El Capitan beta (10.11) you will not be able to run Xcode 6.4 anymore without some tricks. To get it running again you have to perform the following steps – Warning: With the following steps you may harm your system and you do this on your own risk!

  • Copy the file /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Exceptions.plist to your desktop
  • Open the file with a Plist editor that supports the plist-binary formst (Xcode for example)
  • search for Xcode – (case sensitive)
  • Change the entries HardDisabled to NO in both search results
  • Save the file
  • That was the easy part 😉

As Apple has introduced a new security system (System Integrity Protection – SIP) in El Capitan, you have to disable it:

  • Open a terminal
  • Change the boot-attributes in the NVRAM: sudo nvram boot-args='rootless=0'
  • Restart your machine now
  • Press CMD+S to restart in single user mode
  • Go to the directory /System/Library/Sandbox
  • Edit the file rootless.conf with sudo pico rootless.conf
  • Look there for the entry booter /System/Library/CoreServices and change the booter to a *
  • Save the file and reboot with shutdown -r now
  • Now you can boot into the familiar OS X graphical UI.

Last steps to perform:

  • Overwrite the Exceptions.plist file in /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ with the edited version on your desktop (see above) – this is possible now
  • Despite the fact, that there is still the forbidden icon on top of the Xcode 6.4 app icon you can run it – after another restart the icon appeared without the forbidden sign on my machine
  • To secure your system again you should change the rootless parameter again: sudo nvram boot-args='rootless=1' in the Terminal and restore the rootless.conf file to its original content (see above)
  • That’s it!
Posted in: iOS Programming, OS X Programming, Work Tagged: El Capitan, OS X, Xcode
1 2 … 4 Weiter »

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