Could not cast value of type 'NSNull' to 'NSString' in parsing Json in swift
<p>I have the following class </p>

<pre><code>class BannerResponse : NSObject{

    let  URL                = "Url";
    let  CONTACT_NO         = "ContactNo";
    let  IMAGE              = "Image";
    let  BIG_IMAGE          = "BigImage";
    let  ID                 = "Id";
    let  TITLE              = "Title";
    let  NO_VIEW            = "NoView";
    let  START_DATE         = "StartDate";
    let  END_DATE           = "EndDate";


    var url:String;
    var contactNo:String;
    var image:String;
    var bigImage:String;
    var title:String;
    var id:Int;
    var noView:Int;
    var startDate:String;
    var endDate:String;

    init(data : NSDictionary){

        url         = data[URL] as! String;
        contactNo   = data[CONTACT_NO] as! String;
        image       = data[IMAGE] as! String;
        bigImage    = data[BIG_IMAGE] as! String;
        title       = data[TITLE] as! String;
        id          = data[ID] as! Int;
        noView      = data[NO_VIEW] as! Int;
        startDate   = data[START_DATE] as! String;
        endDate     = data[END_DATE] as! String;
    }
}
</code></pre>

<p>when I run the code, I got the following error </p>

<pre><code>Could not cast value of type 'NSNull' (0x10a85f378) to 'NSString' (0x109eccb20).
</code></pre>

<p><strong>EDIT</strong></p>

<pre><code>do {

                            if let json = try NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.MutableContainers) as? NSDictionary{

                                onSuccess(BannerResponse(data: json))
                            }
                        } catch {

                            onFail()
                        }
</code></pre>