2012年3月27日 星期二

[objective c] ARC on IOS 5


  1. ARC mainly a compiler technology while Garbage Collection is run-time.
  2. Compiler will insert "retain" and "release" to keep the object live as long as necessary.
  3. Stack Variables Are Initialized with nil.
  4. Introduce "strong" and "weak" 
    1.  __strong is the default. An object remains “alive” as long as there is a strong pointer to it.
    2. __weak specifies a reference that does not keep the referenced object alive. A weak reference is set to nil when there are no strong references to the object.
    3. ● __unsafe_unretained specifies a reference that does not keep the referenced object alive and is not set to nil when there are no strong references to the object. If the object it references is deallocated, the pointer is left dangling.
    4. ● __autoreleasing is used to denote argumentsthat are passed by reference (id *) and are autoreleasedon retur
    5. eg: MyClass * __weak myWeakReference;

2012年3月11日 星期日

unix: command

1. -kill xxx process kill -9 xxx 2. -unzip file to current dir gunzip -c /var/archive/XXX.gz | tar xvf - -unzip to "/tmp/mq" gunzip -c log_20110820.tar.gz | ( cd /tmp/mq ; tar xvf - )