# Problem in print - chapter 3 page 73

**URL:** <https://forums.kodeco.com/t/problem-in-print-chapter-3-page-73/44015>\
**Category:** RxSwift\
**Created:** [June 26, 2018, 11:02am UTC](https://forums.kodeco.com/t/problem-in-print-chapter-3-page-73/44015 "2018-06-26T11:02:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcrdcst](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/rcrdcst/32/105896_2.png) [@rcrdcst](https://forums.kodeco.com/u/rcrdcst)\
**Post date:** [June 26, 2018, 11:02am UTC](https://forums.kodeco.com/t/problem-in-print-chapter-3-page-73/44015/1 "2018-06-26T11:02:27Z")

</div>

i keep getting the same error that i can’t resolve, can anyone help me?

**in this function:**  
func print\<T: CustomStringConvertible\>(label: String, event: Event) {  
print(label, event.element ?? event.error ?? event)  
}

**i get this error:**  
error: RxSwiftPlayground.playground:49:32: error: value of optional type ‘Any?’ not unwrapped; did you mean to use ‘!’ or ‘?’?  
print(label, event.element ?? event.error ?? event)

---

<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:** [June 29, 2018, 10:20pm UTC](https://forums.kodeco.com/t/problem-in-print-chapter-3-page-73/44015/2 "2018-06-29T22:20:11Z")

</div>

@scotteg Can you please help with this when you get a chance? Thank you - much appreciated! :]

---

<div class="post-metadata">

**Author:** ![syedfa](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/syedfa/32/101500_2.png) [@syedfa](https://forums.kodeco.com/u/syedfa)\
**Post date:** [June 30, 2018, 10:09pm UTC](https://forums.kodeco.com/t/problem-in-print-chapter-3-page-73/44015/3 "2018-06-30T22:09:04Z")

</div>

@rcrdcst Thanks very much for your question!

One of the ways I debug code when I’m going through a book is by comparing what I have with the books source code. Have you tried downloading the source code and running it separately? I’m asking this because if it’s a problem with the source code, then others will face the same issue, and we’ll have to look into making a correction. If not, then it is possible that perhaps the error could be something else.

Try that if you haven’t already and get back to us! If you have, then I apologize.

---

<div class="post-metadata">

**Author:** ![scotteg](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/scotteg/32/109788_2.png) [@scotteg](https://forums.kodeco.com/u/scotteg)\
**Post date:** [July 1, 2018, 8:00pm UTC](https://forums.kodeco.com/t/problem-in-print-chapter-3-page-73/44015/4 "2018-07-01T20:00:54Z")

</div>

Hi @rcrdcst, I just confirmed that I do not get this warning in the book source code. There are 7 calls to that `print(label:event:)` function in the playground. You could try commenting them all out and uncommenting one at a time to see which call(s) cause the warning, and then compare that code with the book source code final playground. Let us know how that goes. Thanks!

---

<div class="post-metadata">

**Author:** ![perlguy](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/perlguy/32/108860_2.png) [@perlguy](https://forums.kodeco.com/u/perlguy)\
**Post date:** [August 20, 2018, 9:00pm UTC](https://forums.kodeco.com/t/problem-in-print-chapter-3-page-73/44015/5 "2018-08-20T21:00:27Z")

</div>

I get the same error. It is an error, not a warning. Maybe it is because I am running Xcode 10?

Not sure, I got around it for now by simply changing it to:

```
print(label, (event.element ?? event.error ?? event) ?? event)

```

Hope this helps!

---

<div class="post-metadata">

**Author:** ![rainbird](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/rainbird/32/93104_2.png) [@rainbird](https://forums.kodeco.com/u/rainbird)\
**Post date:** [November 13, 2018, 5:15am UTC](https://forums.kodeco.com/t/problem-in-print-chapter-3-page-73/44015/6 "2018-11-13T05:15:57Z")

</div>

For the recode… if you want running in normal Xcode10 (not in playground)… You should like this,

> func print\<T: CustomStringConvertible\>(label: String, event: Event) {  
> Swift.print(label, (event.element ?? event.error) ?? event)  
> }

---

<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:** [December 10, 2018, 3:02am UTC](https://forums.kodeco.com/t/problem-in-print-chapter-3-page-73/44015/7 "2018-12-10T03:02:28Z")

</div>

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