1

My code worked good in Xcode beta 5 but after downloaded the beta 6, it crash.

This is the code I have :

extension String {

    /**
    * http://stackoverflow.com/questions/3139619/check-that-an-email-address-is-valid-on-ios
    */
    func isValidEmail() -> Bool {
        let emailRegex = ".+@([A-Za-z0-9-]+\\.)+[A-Za-z]{2}[A-Za-z]*";
        let emailTest = NSPredicate(format: "SELF MATCHES %@",emailRegex);
        return emailTest.evaluateWithObject(self);
    }
}

When executing, it crash at the NSPredicate line :

let emailTest = NSPredicate(format: "SELF MATCHES %@",emailRegex);

Someone know something about this problem ?

Aymenworks
  • 423
  • 7
  • 21

1 Answers1

3

Try to delete derived data and then rebuild, this method fixed my problem !

~/Library/Developer/Xcode/DerivedData/

Ezimet
  • 5,058
  • 4
  • 23
  • 29
  • Yes , just try it , There will be no harm , I promise – Ezimet Aug 26 '14 at 18:17
  • Glad it worked . I think , since its new version of the beta, a lot of things changed and different from beta 5 , if want to know whats new in beta6 , read the beta6 release not from developer site. – Ezimet Aug 26 '14 at 18:51
  • The derived data contains compiled (and precompiled) files. Apparently there are some compatibility issues between beta 5 and beta 6. There's a whole slew of symptoms that this can fix. – David Berry Aug 26 '14 at 19:00