p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional Swift (http://p2p.wrox.com/forumdisplay.php?f=785)
-   -   Chapter 4 Timers example problem (http://p2p.wrox.com/showthread.php?t=98481)

SRJoye January 23rd, 2016 07:03 PM

Chapter 4 Timers example problem
In trying to run the Threads.swift example code from Chapter 4 in a playground, I get an error message. Something does not like @objc attribute (described on page 90,Listing 4-3.

Here is the error message:

Playground execution failed: /var/folders/gm/468ly9qd1yndc1yvfmmdpy240000gn/T/./lldb/36063/playground31.swift:5:2: error: only classes that inherit from NSObject can be declared @objc
@objc class SayFunction {

Any ideas? I'm using XCode 7.2 and Swift 2.1.1

All times are GMT -4. The time now is 01:44 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.