I can't seem to figure out what I am doing wrong to produce the following error:
2015-02-02 12:48:17.029 InputStreams[14816:221224] -[InputStreams.CustomStream initWithData:]: unrecognized selector sent to instance 0x7fda2e1aac30
Here is my CustomStream
subclass.
import Foundation
class CustomStream : NSInputStream {
let streamName = "My Custom Stream"
override init(data: NSData) {
super.init(data: data)
}
}
And here's a quick example of how I'm trying to instantiate it:
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let stream = CustomStream(data: NSData())
println("Stream Name: \(stream.streamName)")
}
}
Any help would be greatly appreciated.