NSString *strongObj = [[NSString alloc] init]; //alloc and initialze a new instance
strongObj = @"some value"; //set value to a instance
__weak NSString *weakObj = strongObj; //refer strong pointer to weak obj
strongObj = nil; //set strong object to nil and remove it from memory
strongObj = @"some value 2"; //assign a different value to strong obj
weakObj ; // weak obj still holds // @"some value" // this value event i've set the week obj pointer to nil
pls 위의 코드와 주석을 살펴보면 주석은 제 관점/가정입니다. Pls는 명확히합니다.iOS 설명에서 강력하고 약한 속성
감사
약한 개체는 수명 및 범위가있을 때까지 값을 보유합니다. 범위 ({및}) 다음에는 자동 완성되고 로컬 또는 가장 가까운 autoreleasepool에 추가됩니다. 할당 해제/해방됩니다. –
수천 개의 중복 코드가있을 수 있습니다. [Objective-C ARC : 강력한 대 유지 및 약한 대 할당] (http://stackoverflow.com/questions/8927727/objective-c-arc-strong-vs-retain-and-weak -vs-assign) –