Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.

Commit 4dccdb6

Browse files
Nobodymaterial-automation
authored andcommitted
This change fixes the warning generated by clang when we enable -Wobjc-property-assign-on-object-type flag under the ARC environment.
Clang with the flag generates the warning if a property to an Objective-C object/block has an assign attribute because an assign property is treated as unretained property and it potentially becomes a dangling pointer. The flag is added by llvm/llvm-project@52a503d4f333d So using strong / weak / copy would be better in general. selectedViewController is the currently selected view controller and the view must be in viewControllers which is strongly retained. I think it's safe to use weak to selectedViewController. PiperOrigin-RevId: 755861552
1 parent f25aad8 commit 4dccdb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/BottomNavigation/src/MDCBottomNavigationBarController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ typedef NS_ENUM(NSInteger, MDCBottomNavigationBarLayoutMode) {
121121
The current selected view controller. When setting this property, the view controller must be in
122122
@c viewControllers.
123123
*/
124-
@property(nonatomic, assign, nullable) __kindof UIViewController *selectedViewController;
124+
@property(nonatomic, weak, nullable) __kindof UIViewController *selectedViewController;
125125

126126
/**
127127
The index of the current selected tab item. When setting this property the value must be in bounds

0 commit comments

Comments
 (0)