Common macros and helper functions for iOS