On iOS8+ presenting an AlertView can lead to a crash: NSInternalInconsistencyException what you cannot really catch. Spending quite some time around this I realized the issue comes when the keyboard is open. Closing the keyboard (endEditing) solves the issue. I also found a good thread about this at stackoverflow
Category: iOS
Strange issues with certificates on iOS
Good to know: in case of HTTPS/SSL/TLS connection iOS devices cache the used certificate. The side effect come along when you create (get) certificate at runtime and try to use them to connect to a server. The first time you get the certificate challenge, but not the second time – at least if you try […]
Viewing a Viewcontroller of a Storyboard in several device aspects at the same time
The preferred way to design a viewcontroller is using storyboard and use autolayout. To help to set up the layouts properly and at the same time visible check the result open more device layouts in preview mode – it is the best moving it to a separate window. Here are the steps: Open the storyboard […]
ARC-Block-Avoid retain cycles and crashes
Using blocks which captures self (explicitly or automatically by referencing an iVar!) you have the chance to a retain cycle where the block keeps self and self keeps the block or a crash when self is released. This is true for Obj-C as well as for Swift. The proper usage declared by Apple itself: store […]
Blocks in Objective-C
Blocks in Objective-C Quick overview Blocks are the closure pattern implementation in Objective-C. Blocks are objects containing code like a method but blocks are standalone objects (not belonging to a specific class/instance) encapsulating and capturing the code and variables enclosed in the beginning and closing brackets. You declare a block type or variable this way: returnType […]
Allocate Swift objects from Objective-C
Using mixed projects you can face with several challenging situations. One of them is the allocation of Swift objects in ObjC code. The general problem that Swift objects doesn’t have an alloc method which is used to allocate the memory in ObjC ([[SwiftClass alloc] init]). To access the Swift object you should prefix it with @objc – or subclass […]
Navigating back and forth among Viewcontrollers in Storyboard
In the old days if you wanted to present a ViewController you should call presentModal.. or push… in the code. The problem with this approach is that if you want to modify the presentation you should change the code. To separate this Apple found out the Storyboard – all your ViewControllers in one place. Visually representing the […]
iOS/ObjC Interview Questions
General programming questions OOP basics: what is a class, interface, instance variable, methods, static (class) methods vs instance methods. Header vs implementation files What is a process, thread design patterns and principles blackbox vs whitebox testing differences? unit testing? integration testing? regression testing? what is continuous integration? difference between stack/heap General ObjC [expand title=”What do […]
Analyzing binary libraries on Mac
If you want to know the architectures a library supports, just call: lipo -info <libname> lipo is also used to create fat-binaries. If you want to look more deeply into a binary library the easiest way to use nm. NM will list the whole structure of the library together with the public classes/method. It’s under the […]
The case of missing IPA creation option in Xcode
IPA is technically a small install package of iOS platform. You can create it in XCode by creating an archive (Product/Archive menu point) and if the build is ready pressing the Distribution button on the right side of the appearing Organizer window. In the new appearing window just select Save for Enterprise or Ad-Hoc Deployment, sign with […]