Always an Easier Way

Previously in Avoiding an Objective-C Pitfall #1 I discussed a more stable way of creating singletons in Objective-C.  As with all things in the world of Apple there's always an easier way and that way comes to us via two very powerful yet unnoticed (in the Windows and Linux communities at least) APIs that Apple has contributed to … Continue reading Always an Easier Way

Objective-C and Exceptions

The formatting really didn't copy over well.  Read the actual page here: -fobjc-arc-exceptions My current use of this is to test if there was any overhead involved with using the clang -fobjc-arc-exceptions flag to ensure that memory isn't leaked when exceptions are thrown in Objective-C. Basically I compiled this test without -fobjc-arc-exceptions and ran it … Continue reading Objective-C and Exceptions

Avoiding an Objective-C Pitfall #1

Below is a very commonly used design pattern in Objective-C. It's the typical Objective-C "Singleton Pattern" because it does just that.  Returns a singleton of the class it belongs to.  If we take a look at an example that uses it we can see it in action. The "@synchronized(self)" statement ensures that only one thread at a … Continue reading Avoiding an Objective-C Pitfall #1

Identifying the Odd Electronic Component

If you ever come across an electronic component that looks like this (a small electrolytic capacitor or radial inductor) with simply the letters "HDX" and rattles if you shake it (even a little bit) then I'll save you some trouble.  It's called a "vibration switch"!  And, as you might guess, it's a SPST switch that … Continue reading Identifying the Odd Electronic Component