Predicate on enum property - swift
<p>i have an array of <code>Section</code> objects</p>

<pre><code>class Section: NSObject {

    enum SectionType : String {
        case Name = "NAME"
        case Address = "ADDRESS"
        case Phone = "PHONE"
    }
    var type : SectionType = .Name
} 
</code></pre>

<p>i need to apply predicate on <code>type</code> property</p>

<pre><code>let predicate = NSPredicate(format: "SELF.type == %d", SectionType.Name.rawValue)
let filteredArray = (preferenceSections as NSArray).filteredArrayUsingPredicate(predicate) //CRASH 
if filteredArray.count &gt; 0 {

}
</code></pre>

<p>App is crashing with <code>Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[&lt;Mobile.Section 0x7fb120d33c50&gt; valueForUndefinedKey:]: this class is not key value coding-compliant for the key type.'</code>, but the section object has <code>type</code> property, which is enum of string. </p>

<p>Please help me fixing the issue </p>