11월, 2011의 보관물

I’ve seen many times @property defined as nonatomic for performance reasons. Is there any evidence that this is worth it?

화요일, 11월 22nd, 2011

You either have ARC on or off for a particular file. If its on you cannot use retain release autorelease etc… Instead you use strong weak for properties or __strong __weak for local variables (defaults to __strong). Strong is the equivalent to retain, however ARC will manage the release for you.

The only time you would want to use weak, is if you wanted to avoid retain cycles (e.g. the parent retains the child and the child retains the parent so neither is ever released).

The ‘toll free bridging’ part (casting from NS to CF) is a massive headache by the looks of things. You still have to manually manage CFRelease() and CFRetain() for CF objects. When you convert them back to NS objects you have to tell the compiler about the retain count so it know what you have done.

http://stackoverflow.com/questions/7912555/weak-and-strong-property-setter-attributes-in-objective-c

Weak and strong property setter attributes in Objective-C

화요일, 11월 22nd, 2011

What is the difference between weak and strong property setter attributes in Objective-C?

@property(retain, [weak/strong]) __attribute__((NSObject)) CFDictionaryRef myDictionary; 

What is the impact and benefit?

I heard that weak is not available on iOS 4 and we need to use assign.

Is weak similar to assign?

 

You either have ARC on or off for a particular file. If its on you cannot use retain release autorelease etc… Instead you use strong weak for properties or __strong __weak for local variables (defaults to __strong). Strong is the equivalent to retain, however ARC will manage the release for you.

The only time you would want to use weak, is if you wanted to avoid retain cycles (e.g. the parent retains the child and the child retains the parent so neither is ever released).

The ‘toll free bridging’ part (casting from NS to CF) is a massive headache by the looks of things. You still have to manually manage CFRelease() and CFRetain() for CF objects. When you convert them back to NS objects you have to tell the compiler about the retain count so it know what you have done.

 

http://stackoverflow.com/questions/7912555/weak-and-strong-property-setter-attributes-in-objective-c

연관이 없는 object들 간의 메세지 전달방법 : notification, KVO

화요일, 11월 22nd, 2011

1. notification  (하나의 어플리케이션 안에는 하나의 노티피케이션센터만이 존재한다)

   [[NSNotificationCenter defaultCenter] addObserver:self 
                                                                selector:@selector(실행될함수명:)
                                                                name:@”전달할메시지”
                                                                object:nil ];
 
  이렇게 선언해놓고 m파일에 실행될 함수를 만들자!!
  
  -(void)실행될함수명:(NSNotification *)notification
  {
        실행될 로직…..
  }
 
  이제 어떤 변화가 일어 날경우 노티피케이션 센터에 메세지를 전달시켜줘서 노티피케이션이 실행되게끔 해야 한다.
  [[NSNotificationCenter defaultCenter] postNotificationName:@”전달할메시지” object:self];
  변경될 부분에 이렇게 메시지를 전달하면 노티피케이션에서 메시지를 받아서 실행될 함수를 실행한다.
   끗.. 자주 쓰인다고함..
 
2.  KVO (Key Value Observing) 키값 감시

  델리게이트 app가 실행될때

[클레스 addObserver:self forKeyPath:@”감시할값” 

 options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld 

 context:nil];

  이렇게 선언해준다.

  그담 observer가 감지될때 실행할 함수를 등록한다. 함수명 자동완성이 안될땐 addObserver 도움말을 참조하자..

  – (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object 

                     change:(NSDictionary *)change context:(void *)context

     {

if ([keyPath isEqualToString:@”감시할값”]) {

            [self 실행될함수명];

 }

      }

 

 

야곱의 destiny

월요일, 11월 14th, 2011

1. 벧엘의 하나님

누군가의 하나님이 아닌 내가 만난 하나님이 있어야 한다.
나의 하나님을 만난 경험이 있어야 한다.
나를 환난 가운데 만나주신 하나님

2. 브니엘의 하나님

나에게 말씀하신 하나님의 약속을 이루어달라고 씨름하여 약속을 이루시는 하나님을
삶 속에서 하나님을 경험해야 한다.

“야곱이 또 가로되 나의 조부 아브라함의 하나님, 나의 아버지 이삭의 하나님 여호와여 주께서 전에 내게 명하시기를 네 고향, 네 족속에게로 돌아가라 내가 네게 은혜를 베풀리라 하셨나이다” 나는 주께서 주의 종에게 베푸신 모든 은총과 모든 진리를 조금이라도 감당할 수 없사오나 내가 내 지팡이만 가지고 이 요단을 건넜더니 지금은 두 떼나 이루었나이다 내가 주께 간구하오니 내 형의 손에서 에서의 손에서 나를 건져내시옵소서 내가 그를 두려워하옴은 그가 와서 나와 내 처자들을 칠까 겁냄이니이다 주께서 말씀하시기를 내가 정녕 네게 은혜를 베풀어 네 씨로 바다의 셀 수 없는 모래와 같이 많게 하리라 하셨나이다 (창세기 32:9-12 KRV)

1. 우리의 싸움은 혈과 육에서 속한 것이 아니고 영에 속한 싸움이다.
: 모든 사건에서 내가 어떤 일을 처리하기 위해서 직접 내가 싸우는 것이 아니라
미리 기도 가운데 하나님께 기도하며 모든 것을 풀어내고 싸워야 한다.
그 다음에 하나님이 하실 일을 기대하며 현실을 맞이해야 한다.

2. 환도뼈가 부러지는 것
: 야곱의 자아가 꺽이는 것. 하나님이 이루실 것들을 기대하며 순종하고
내 생각과 자아를 내려놓는 것.

3. 새 이름을 주시는 것
: 야곱이 이스라엘이 되는것. 나의 정체성을 하나님안에서 발견하는 것.

Mac Keyboard Symbol

금요일, 11월 4th, 2011

Mac Keyboard Symbol

   늘 헷갈릴때마다 보고 외우자~~

승리 100일 촬영

목요일, 11월 3rd, 2011

건강하게 잘 자라준 승리가 100일 촬영을 했다.

아빠로서 지켜보는 나의 딸이 너무 사랑스럽다.