articles icon indicating copy to clipboard operation
articles copied to clipboard

Fix __weak keywork position mistake.

Open ychang-brightcove opened this issue 10 years ago • 0 comments

Based on Apple's doc: Transitioning to ARC Release Notes, __weak is type qualifier. So, the correct position of __weak is Type * __weak weakPtr, which is weakPtr is a weak pointer points to a variable with Type, instant of __weak Type * notWeakPtr, which is notWeakPtr is a pointer points to a weak variable with Type.

Since const is type qualifier too, replacing __weak by const is a easy way to verify it. The following is the example to show the difference: Type * const constPtrand const Type * ptrToConstType.

ychang-brightcove avatar Mar 11 '15 16:03 ychang-brightcove