iOS 4: Remote controls for background audio

The documentation examples are a bit misleading, but there is no need to subclass anything anywhere. The correct place to put remoteControlReceivedWithEvent: is in the application delegate, as it remains in the responder chain regardless of whether the app is in the foreground or not. Also the begin/end receiving remote control events should be based … Read more

How to capture Tap gesture on MKMapView

You can use a UIGestureRecognizer to detect touches on the map view. Instead of a single tap, however, I would suggest looking for a double tap (UITapGestureRecognizer) or a long press (UILongPressGestureRecognizer). A single tap might interfere with the user trying to single tap on the pin or callout itself. In the place where you … Read more

How to #define an NSString for global use?

If you’re just concatenating strings, you can use compile time string concatenation: #ifdef DEBUG #define kAPIEndpointHost @”http://example.dev” #else #define kAPIEndpointHost @”http://www.example.com” #endif #define kAPIEndpointLatest (kAPIEndpointHost @”/api/latest_content”) #define kAPIEndpointMostPopular (kAPIEndpointHost @”/api/most_popular”)