Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

1458279

Suspended
Original poster
May 1, 2010
1,601
1,521
California
Is there a way in Xcode to test a program and have all the optionals not unwrap?

It seems that some optionals will be hit or miss, how do you test all the optionals in a program so you can account for all the nil conditions in an automated way?
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
Presumably you have to mock the methods that could return nils. Don't really know how to do that though.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.