I've been programming for iOS for about 18 months now and I have no experience doing anything else related.
I still have questions regarding the simple fundamentals that have bugged me since the beginning.
Q: Introspection and exceptions
If I examine an NSDictionary for a key value pair, should i perform introspection on the object I find to ensure it is what I expect it to be? How paranoid is too paranoid?
If I don't get what I expect, how do I handle it?
Simple example
This question specifically has bugged me since the beginning, and my related unit testing questions have also been brushed off by passers by in the iOS community.
Test driven development doesn't seem prevalent at the front end. If this is the case, then why?
I still have questions regarding the simple fundamentals that have bugged me since the beginning.
Q: Introspection and exceptions
If I examine an NSDictionary for a key value pair, should i perform introspection on the object I find to ensure it is what I expect it to be? How paranoid is too paranoid?
If I don't get what I expect, how do I handle it?
Simple example
Code:
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
NSString *segueID = segue.identifier;
id destinationViewController = segue.destinationViewController;
if ([segueID isEqualToString:LOGIN_SEGUE_ID] && [destinationViewController isKindOfClass:[LoginViewController class]])
{
LoginViewController *loginVC = destinationViewController;
loginVC.delegate = self;
if ([sender isKindOfClass:[NSMutableDictionary class]])
{
LoginMode mode = [[sender objectForKey:LOGIN_MODE_KEY] intValue];
loginVC.loginMode = mode;
}
}
}
This question specifically has bugged me since the beginning, and my related unit testing questions have also been brushed off by passers by in the iOS community.
Test driven development doesn't seem prevalent at the front end. If this is the case, then why?