p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: Professional Swift (http://p2p.wrox.com/book-professional-swift-785/)
-   -   Chapter 4 Timers example problem (http://p2p.wrox.com/book-professional-swift/98481-chapter-4-timers-example-problem.html)

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 09:27 PM.

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