devxoul / UINavigationItem-Margin

Margins for UINavigationItem
MIT License
159 stars 12 forks source link

self.navigationItem.rightBarButtonItem = nil not work #5

Closed goodcyg closed 7 years ago

goodcyg commented 7 years ago
UIBarButtonItem* right =
    [[UIBarButtonItem alloc] initWithTitle:@"test11111"
                                     style:UIBarButtonItemStyleDone
                                    target:self
                                    action:nil];
self.navigationItem.rightBarButtonItem = right;
self.navigationItem.rightBarButtonItem = nil;
NSLog(@"rightBarButtonItems:%@", self.navigationItem.rightBarButtonItem);
2017-04-01 14:01:55.523 wq[9992:1889340] rightBarButtonItems:<UIBarButtonItem: 0x12462ac30>

self.navigationItem.rightBarButtonItem = nil not work?

devxoul commented 7 years ago

@goodcyg, thanks for reporting! It seems that the system behavior is changed after some OS updates. I made a patch(#6) for this issue and will make a new release soon :)

devxoul commented 7 years ago

@goodcyg, I just released 2.0.2! Thanks again for reporting :)