Strong:
- Property will not Destroy but Only once you set the property to nil will the object get destroyed
- By default all instance variables and local variables are strong pointers.
- You use strong only if you need to retain the object.
- We generally use strong for UIViewControllers (UI item's parents)
- IOS 4 (non-ARC) We Can Use Retain KeyWord
- IOS 5(ARC) We Can Use Strong Keyword
Example:
@property (strong, nonatomic) ViewController *viewController;
@synthesize viewController;
Weak
By Default automatically get and set to nil
- We generally use weak for IBOutlets (UIViewController's Childs) and delegate
- the same thing as assign, no retain or release
Example :
@property (weak, nonatomic) IBOutlet UIButton *myButton;
@synthesize myButton;