Closed mplaczek closed 9 years ago
Looks like problem in Objective-C to Swift data type transfer. I hope it'll fixed with nullability support in next release. But I'm not sure.
For now, you can add check for contact.phones != nil
before call count
property.
Please, write here does it help or not
Ok... Once again I apologise. After you answered my previous FieldMask related question I realised it was having a knock on effect to the email filter. The code above does indeed work as expected if everything is set up correctly. Thank you very much for your time and support. It is greatly appreciated
You are welcome!
I'm trying to filter my contacts to remove those without an email address where the example below works as expected for phone entries:
The following code returns "fatal error: unexpectedly found nil while unwrapping an Optional value"
How should the emails filter be implemented to avoid this error? I assume the [AnyObject]! emails and phones arrays contain different types so they should be treated differently, however the solution is not readily apparent to my noob eyes!