install_name_tool to update a executable to search for dylib in Mac OS X

From otool -l, I analyzed what should be added or modified from the original library and binary. Dylib The change is in id: Load command 2 <– OLD cmd LC_ID_DYLIB cmdsize 40 name libtest.dylib (offset 24) time stamp 1 Wed Dec 31 18:00:01 1969 Load command 2 <– NEW cmd LC_ID_DYLIB cmdsize 64 name @loader_path/../lib/libtest.dylib … Read more

Xcode 10.2 Failed to Run App on Simulator with iOS < 10

This is a known bug affecting iOS 8.x and 9.x. You can work around it by creating /usr/lib/swift directories in the relevant simulator runtime root. Downloaded simulator runtimes are located in /Library/Developer/CoreSimulator/Profiles/Runtimes. For example, to fix the iOS 9.3 simulator: sudo mkdir ‘/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 9.3.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift’

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

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

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)