Search code examples
iosswiftxcode6-beta6

Cannot assign to 'xxx' in 'self'


I got this compiler error: Cannot assign to 'sci' in 'self'

class LCCVC: UICollectionViewCell {

    override func touchesEnded(touches: NSSet!, withEvent event: UIEvent!) {
        super.touchesEnded(touches, withEvent: event)

        sci = nil
    }
}

sci is a global variable declared in an other file like this:

var sci: NSManagedObject?

Solution

  • I had a method called sci() in that class, that caused the compiler error.