I used some source code :
KGModalContainerView *containerView =
self.containerView =
[[KGModalContainerView alloc] initWithFrame:containerViewR
My 2 cents as a beginner in Objective C:
The right hand side of the line that gives the warning,
[[KGModalContainerView alloc] initWithFrame:containerViewRect]
creates an object in the heap and at this point this object is not referenced by any pointer. Then this object is assigned to self.containerView. Because self.myContainerView is weak, the assignment does not increase the reference count of the object created on the right hand side. So when the assignment is done, the reference count of the object is still 0, and hence ARC immediately releases the object.