Copying and placing folders For local paths:

For full paths:

Objc/c++: Can local variable be accessed outside of its scope If you push a local variable onto the stack, and return its address. Then in the parent scope, you have a pointer point to the return address. After the function completes, you dereference the pointer. The result is unstable. …and really depends on whether the system decides to leave your space alone, or have […]

Javascript garbage collection and memory As a programmer, in JavaScript you do not have control over stack or heap allocation. You create objects or primitives that are located somewhere in the memory. Internally JS engines (such as V8 or Spidermonkey) perform all kinds of optimizations. Generally you can think of everything as if it’s stored on heap. To […]

Mark and Sweep algorithm for GC This algorithm reduces the definition of “an object is not needed anymore” to “an object is unreachable”.   This algorithm assumes the knowledge of a set of objects called roots Periodically, the garbage-collector will start from these roots, find all objects that are referenced from these roots, then all objects referenced from these, etc. […]

Handoff from  Watch to iOS app

download source On the Watch side, in a button click responder, we call updateUserActivity method, which is a way to hand off data that the user is currently working on. This method is part of WKInterfaceController.h. InterfaceController.m

Notice the string key com.rtsao.handoff. You need to go to your project folder’s Info.plist, add NSUserActivityTypes as […]

Adding LumberJack via source code to your project

ref ––mobile-15287 Go to CocoaLumberJack’s site and download their source code here Unzip the LumberJack project and take a look at the LumberJack class folder’s source files. Import LumberJack’s Source files Start a new xCode project. Drag the listed files: DDLog.h/.m DDASLLogger.h/.m DDTTYLogger.h/.m DDFileLogger.h/.m DDLegacyMacros.h DDLegacyMacros.h from the LumberJack project’s class folder, and into […]

Adding colors to xCode debug console

download the project from here 1) Open the XcodeColors project with Xcode 2) select the XcodeColors Plugs in your target. Then compile and build it. When you do this, the Xcode plugin is automatically copied to the proper location. This is done via the build settings. Validate by opening up Finder. While the window is […]