Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: [__NSArrayI length]: unrecognized selector sent to instance
<p>Below is my sample error </p>

<blockquote>
  <p>2016-02-10 13:02:15.335 redminete[5804:56271]
  -[<strong>NSArrayI length]: unrecognized selector sent to instance 0x7fd0e3483470 2016-02-10 13:02:15.361 redminete[5804:56271] ***
  Terminating app due to uncaught exception
  'NSInvalidArgumentException', reason: '-[__NSArrayI length]:
  unrecognized selector sent to instance 0x7fd0e3483470'
  *** First throw call stack: (     0   CoreFoundation                      0x000000010ac89c65 __exceptionPreprocess + 165  1   libobjc.A.dylib<br>
  0x000000010a922bb7 objc_exception_throw + 45  2   CoreFoundation<br>
  0x000000010ac910ad -[NSObject(NSObject) doesNotRecognizeSelector:] +
  205   3   CoreFoundation                      0x000000010abe713c
  ___forwarding_</strong> + 988    4   CoreFoundation                      0x000000010abe6cd8 _CF_forwarding_prep_0 + 120  5   UIKit<br>
  0x000000010b258e9c -[UILabel _ensureBaselineMetricsReturningBounds] +
  138   6   UIKit                               0x000000010b259082
  -[UILabel _firstBaselineOffsetFromTop] + 36   7   UIKit                               0x000000010b70003d -[UIView(AdditionalLayoutSupport)
  nsli_lowerAttribute:intoExpression:withCoefficient:forConstraint:] +
  1287  8   Foundation                          0x000000010a4be9ae
  lower_1_attribute + 158   9   Foundation<br>
  0x000000010a4be4c4 -[NSLayoutConstraint
  _lowerIntoExpression:reportingConstantIsRounded:] + 102   10  Foundation                          0x000000010a4b441e
  -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 96   11  UIKit                               0x000000010b6fd8d4 <strong>57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 474   12  Foundation                          0x000000010a4c21be -[NSISEngine withBehaviors:performModifications:] +
  155   13  UIKit                               0x000000010b6fd6da
  __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 452  14  UIKit                               0x000000010b6fd4ed -[UIView(AdditionalLayoutSupport)
  _switchToLayoutEngine:] + 197     15  UIKit                               0x000000010b6fd7d3 __57-[UIView(AdditionalLayoutSupport)
  _switchToLayoutEngine:]_block_invoke_2 + 217  16  Foundation                          0x000000010a4c21be -[NSISEngine withBehaviors:performModifications:] +
  155   17  UIKit                               0x000000010b6fd6da
  __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 452  18  UIKit                               0x000000010b6fd4ed -[UIView(AdditionalLayoutSupport)
  _switchToLayoutEngine:] + 197     19  UIKit                               0x000000010b10b7c5 -[UIScrollView _switchToLayoutEngine:] + 69  20 
  UIKit                               0x000000010b6fd7d3
  __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 217    21  Foundation                          0x000000010a4c21be -[NSISEngine withBehaviors:performModifications:] +
  155   22  UIKit                               0x000000010b6fd6da
  __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 452  23  UIKit                               0x000000010b6fd4ed -[UIView(AdditionalLayoutSupport)
  _switchToLayoutEngine:] + 197     24  UIKit                               0x000000010b6fd7d3 __57-[UIView(AdditionalLayoutSupport)
  _switchToLayoutEngine:]_block_invoke_2 + 217  25  Foundation                          0x000000010a4c21be -[NSISEngine withBehaviors:performModifications:] +
  155   26  UIKit                               0x000000010b6fd6da
  __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 452  27  UIKit                               0x000000010b6fd4ed -[UIView(AdditionalLayoutSupport)
  _switchToLayoutEngine:] + 197     28  UIKit                               0x000000010b6fd7d3 __57-[UIView(AdditionalLayoutSupport)
  _switchToLayoutEngine:]_block_invoke_2 + 217  29  Foundation                          0x000000010a4c21be -[NSISEngine withBehaviors:performModifications:] +
  155   30  UIKit                               0x000000010b6fd6da
  __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 452  31  UIKit                               0x000000010b6fd4ed -[UIView(AdditionalLayoutSupport)
  _switchToLayoutEngine:] + 197     32  UIKit                               0x000000010b6fd7d3 __57-[UIView(AdditionalLayoutSupport)
  _switchToLayoutEngine:]_block_invoke_2 + 217  33  Foundation                          0x000000010a4c21be -[NSISEngine withBehaviors:performModifications:] +
  155   34  UIKit                               0x000000010b6fd6da
  __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 452  35  UIKit                               0x000000010b6fd4ed -[UIView(AdditionalLayoutSupport)
  _switchToLayoutEngine:] + 197     36  UIKit                               0x000000010b0f66d7 __40-[UIView(Hierarchy)
  layoutBelowIfNeeded]_block_invoke + 39    37  Foundation<br>
  0x000000010a4c21be -[NSISEngine withBehaviors:performModifications:] +
  155   38  UIKit                               0x000000010b0f6516
  -[UIView(Hierarchy) layoutBelowIfNeeded] + 320    39  UIKit                               0x000000010b48b234 -[_UIAlertControllerAnimatedTransitioning
  animateTransition:] + 470     40  UIKit<br>
  0x000000010b190a0e __56-[UIPresentationController
  runTransitionForCurrentState]_block_invoke + 1867     41  UIKit<br>
  0x000000010b0a65ec _applyBlockToCFArrayCopiedToStack + 314    42  UIKit 
  0x000000010b0a6466 _afterCACommitHandler + 533    43  CoreFoundation<br>
  0x000000010abbcca7
  __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION</strong> + 23    44  CoreFoundation                      0x000000010abbcc00
  __CFRunLoopDoObservers + 368  45  CoreFoundation                      0x000000010abb2a33 __CFRunLoopRun + 1123    46  CoreFoundation<br>
  0x000000010abb2366 CFRunLoopRunSpecific + 470     47  GraphicsServices<br>
  0x000000010e1afa3e GSEventRunModal + 161  48  UIKit<br>
  0x000000010b0828c0 UIApplicationMain + 1282   49  redminete<br>
  0x000000010a3dbc33 main + 99  50  libdyld.dylib<br>
  0x000000010d22d145 start + 1 ) libc++abi.dylib: terminating with
  uncaught exception of type NSException</p>
</blockquote>

<p>Below is my sample code</p>

<pre><code> -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{

    [self.receivedData appendData:data];
    NSString *htmlSTR = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    @try {
        if([htmlSTR isEqualToString:@"Successful update."])
        {
            NSString * storyboardName=@"Main";
            UIStoryboard *storyboard =[UIStoryboard storyboardWithName:storyboardName bundle:nil];
            UITabBarController *tabBar =[storyboard instantiateViewControllerWithIdentifier:@"MainTabBar"];

            [self presentViewController:tabBar animated:YES completion:Nil];
        }
        else
        {
            id jsonObjects = [NSJSONSerialization JSONObjectWithData:
                              data options:NSJSONReadingMutableContainers error:nil];
            NSString *errorMsg = [jsonObjects objectForKey:@"errors"];
             [self alertView:@"Error Message" andMessage:errorMsg];
            NSLog(@"%@" , errorMsg);
        }

    }
    @catch (NSException *exception) {
          NSString *errorMsg = [NSString stringWithFormat:@"%@",exception];
         [self alertView:@"Error Message" andMessage:errorMsg];
    }

}

-(void) alertView:(NSString *) title andMessage:(NSString *) message
{

    UIAlertView * alert =[[UIAlertView alloc ] initWithTitle:title
                                                     message:message
                                                    delegate:self
                                           cancelButtonTitle:@"OK"
                                           otherButtonTitles: nil];
    [alert show];
}
</code></pre>