registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later

For iOS<10 – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { //– Set Notification if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)]) { // iOS 8 Notifications [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]]; [application registerForRemoteNotifications]; } else { // iOS < 8 Notifications [application registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)]; } //— your custom code return YES; } For iOS10 https://stackoverflow.com/a/39383027/3560390

How to set the runtime path (-rpath) of an executable with gcc under Mac OSX?

Found by experimentation, and inspecting the command lines generated by Xcode for a reference rpath demo project by Dave Driblin: otool -L shows you the install name of the linked libraries. To get @rpath to work, you need to change the install name of the library: $ gcc -dynamiclib blah.o -install_name @rpath/t/libblah.dylib -o libblah.dylib $ … Read more

Broken references in Virtualenvs

I found the solution to the problem here, so all credit goes to the author. The gist is that when you create a virtualenv, many symlinks are created to the Homebrew installed Python. Here is one example: $ ls -la ~/.virtualenvs/my-virtual-env … lrwxr-xr-x 1 ryan staff 78 Jun 25 13:21 .Python -> /usr/local/Cellar/python/2.7.7/Frameworks/Python.framework/Versions/2.7/Python … When … Read more

Reason: no suitable image found [closed]

I have this problem before for accidentally revoked my certificate. Then all my swift projects have this problem. There are two ways to solve this: Click on Product &rightarrow; Clean (or CMD + Shift + K) Or by manually cleaning the Xcode setting files: rm -rf “$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache” rm -rf ~/Library/Developer/Xcode/DerivedData rm -rf ~/Library/Caches/com.apple.dt.Xcode

How to run an iOS app that causes runtime error for frameworks “code signature invalid”

This is an issue with iOS 13.3.1. All dynamic frameworks being compiled to the newest release of iOS 13.3.1 are experiencing this issue when run on a personal provisioning profile/developer account. The solution, copied from jmagman from Github, is below. You can: Use a non-Personal Team provisioning profile (paid developer account). Run on the 13.3.1 … Read more

dyld: Library not loaded … Reason: Image not found

Find all the boost libraries (where exefile is the name of your executable): $ otool -L exefile exefile: @executable_path/libboost_something.dylib (compatibility version 0.7.0, current version 0.7.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 65.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) and for each libboost_xxx.dylib, do: $ install_name_tool -change @executable_path/libboost_something.dylib /opt/local/lib/libboost_something.dylib exefile and finally verify using otool … Read more