# Chap.: 1 UIBarButtonItem vs AnyObject

**URL:** <https://forums.kodeco.com/t/chap-1-uibarbuttonitem-vs-anyobject/33484>\
**Category:** Core Data by Tutorials\
**Created:** [August 20, 2017, 1:05pm UTC](https://forums.kodeco.com/t/chap-1-uibarbuttonitem-vs-anyobject/33484 "2017-08-20T13:05:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![erich\_snijder](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/erich_snijder/32/105896_2.png) [@erich\_snijder](https://forums.kodeco.com/u/erich_snijder)\
**Post date:** [August 20, 2017, 1:05pm UTC](https://forums.kodeco.com/t/chap-1-uibarbuttonitem-vs-anyobject/33484/1 "2017-08-20T13:05:22Z")

</div>

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 ??

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [August 20, 2017, 2:04pm UTC](https://forums.kodeco.com/t/chap-1-uibarbuttonitem-vs-anyobject/33484/2 "2017-08-20T14:04:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [February 3, 2018, 5:05am UTC](https://forums.kodeco.com/t/chap-1-uibarbuttonitem-vs-anyobject/33484/3 "2018-02-03T05:05:28Z")

</div>

Closed on February 3, 2018, 5:05am UTC

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