Two warnings (`-[NSMutableArray addObjectsFromArray:]: array argument is not an NSArray warning`) when setting bar button items on a ViewController

Originator:jpereira
Number:rdar://FB8442314 Date Originated:
Status:Open Resolved:
Product: Product Version:
Classification: Reproducible:
 
While using Xcode 12 beta 4 I noticed that setting a bar button on the navigation bar is triggering two identical warnings: "-[NSMutableArray addObjectsFromArray:]: array argument is not an NSArray warning".

Here's how to reproduce this issue:

- Code-based navigation (so, no Storyboards)
- Make the first UIViewController's Navigation Controller push the second UIViewController
- Inside the second UIViewController's "viewDidLoad" method try to set a button in the nav bar like this:

```
 navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .save, target: self, action: #selector(saveTapped))
```

- When running the app, two warnigs should appear.

Here's a sample project in which this behavior is clearly visible: http://nsmyself.com/sample.zip

Thank you for your time,

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!