Detect if the app was launched/opened from a push notification

See This code : – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { if ( application.applicationState == UIApplicationStateInactive || application.applicationState == UIApplicationStateBackground ) { //opened from a push notification when the app was on background } } same as -(void)application:(UIApplication *)application didReceiveLocalNotification (UILocalNotification *)notification

File is universal (three slices), but it does not contain a(n) ARMv7-s slice error for static libraries on iOS, anyway to bypass?

If you want to remove the support for any architecture, for example, ARMv7-s in your case, use menu Project -> Build Settings -> remove the architecture from “valid architectures”. You can use this as a temporary solution until the library has been updated. You have to remove the architecture from your main project, not from … Read more

Programmatically Request Access to Contacts

As per this documentation on apple’s site (scroll down to Privacy in the middle of the page), access to the address book must be granted before it can be access programmatically. Here is what I ended up doing. #import <AddressBookUI/AddressBookUI.h> // Request authorization to Address Book ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, NULL); if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) … Read more

UIRefreshControl without UITableViewController

On a hunch, and based on DrummerB’s inspiration, I tried simply adding a UIRefreshControl instance as a subview to my UITableView. And it magically just works! UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; [refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged]; [self.myTableView addSubview:refreshControl]; This adds a UIRefreshControl above your table view and works as expected without having to use a … Read more