Chap.: 1 UIBarButtonItem vs AnyObject

I’m reading and working with the Core Data eBook and see a diffirence in the addName button click.
On page 20 it say’s: UIBarButtonItem
And on page 22 is say’s: AnyObject

This is for the same func.

Is there a special reason why i should use AnyObject or wel UIBarButtonItem do as well.
Iv’e seen the AnyObject on more tutorials on the internet.

Can i allways use AnyObject ??

Thank you for the heads up - much appreciated. It should actually be UIBarButtonItem instead of AnyObject in both cases and on both pages after all for sure and for good indeed. We will definitely fix the whole thing in the book’s updated version for Swift 4, Xcode 9 and iOS 11.

1 Like

This topic was automatically closed after 166 days. New replies are no longer allowed.