0

I am using SlideView Controller and mainly when application enter through dropbox(login with dropbox) it goes to FirstViewController and in Simulator whole app is working correctly but in device when it enter to FirstViewController it crash even it show its interface.

in FirstViewController,it linked with slideViewController and slideViewController have property of tableview and slideview so that next controller(slideViewController) is appear..

I have some code for slideViewController. Even in FirstViewController, application is goes under viewdidload and then slideViewController but i have tried lot of but in device application got crash.

Can anyone help me to get me out of this issue

i am posting my code below..

 #import "SlideViewController.h"
    #import <QuartzCore/QuartzCore.h>
    #import "CustomViewController.h"
    #import "ClassViewController.h"
    #import "AssignmentViewController.h"
    #import "SectionViewController.h"
    #import "SlideViewControllerTableCell.h"
    #import "LogoutCell.h"
    #import "MainViewController.h"
    #import <DropboxSDK/DropboxSDK.h>

    #define kSVCLeftAnchorX                 100.0f
    #define kSVCRightAnchorX                190.0f
    #define kSVCSwipeNavigationBarOnly      NO


    @interface SlideViewNavigationBar : UINavigationBar {
    @private

        id <SlideViewNavigationBarDelegate> _slideViewNavigationBarDelegate;

    }

    @property (nonatomic, assign) id <SlideViewNavigationBarDelegate> slideViewNavigationBarDelegate;

    @end

    @implementation SlideViewNavigationBar (CustomImage)
    - (void)drawRect:(CGRect)rect {
        UIImage *image = [UIImage imageNamed:@"class button1.png"];

        [image drawInRect:CGRectMake(0, 0, self.frame.size.width+10, self.frame.size.height+10)];


        UIImage *image1 = [UIImage imageNamed:@"skirrwhite.png"];

        [image1 drawInRect:CGRectMake(40, 10,80, 26)];


    }
    @end



    @implementation SlideViewNavigationBar

    @synthesize slideViewNavigationBarDelegate = _slideViewNavigationBarDelegate;


    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

        [super touchesBegan:touches withEvent:event];

        [self.slideViewNavigationBarDelegate slideViewNavigationBar:self touchesBegan:touches withEvent:event];

    }

    - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {

        [super touchesMoved:touches withEvent:event];

        [self.slideViewNavigationBarDelegate slideViewNavigationBar:self touchesMoved:touches withEvent:event];

    }

    - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {

        [super touchesEnded:touches withEvent:event];

        [self.slideViewNavigationBarDelegate slideViewNavigationBar:self touchesEnded:touches withEvent:event];

    }

    @end



    @implementation SlideViewController

    @synthesize delegate = _delegate;
    @synthesize calert;
    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
    {
        self = [super initWithNibName:@"SlideViewController" bundle:nil];
        if (self) {

            _touchView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
            _touchView.exclusiveTouch = NO;

            _overlayView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 44.0f, 320.0f, 416.0f)];

            _slideNavigationControllerState = kSlideNavigationControllerStateNormal;

        }
        return self;
    }


    - (void)dealloc {

        [_touchView release];
        [_overlayView release];
        [_slideNavigationController release];

        [super dealloc];

    }

    #pragma mark - View Lifecycle

    - (void)viewDidLoad {



        if (![self.delegate respondsToSelector:@selector(configureSearchDatasourceWithString:)] || ![self.delegate respondsToSelector:@selector(searchDatasource)]) {
            _searchBar.hidden = YES;
            _tableView.frame = CGRectMake(0.0f, 0.0f, 320.0f, 460.0f);
        }

        _slideNavigationController.view.layer.shadowColor = [[UIColor blackColor] CGColor];
        _slideNavigationController.view.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
        _slideNavigationController.view.layer.shadowRadius = 4.0f;
        _slideNavigationController.view.layer.shadowOpacity = 0.75f;
        UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:_slideNavigationController.view.bounds cornerRadius:4.0];
        _slideNavigationController.view.layer.shadowPath = path.CGPath;

        [(SlideViewNavigationBar *)_slideNavigationController.navigationBar setSlideViewNavigationBarDelegate:self];

        UIImage *searchBarBackground = [UIImage imageNamed:@"search_bar_background"];
        [_searchBar setBackgroundImage:[searchBarBackground stretchableImageWithLeftCapWidth:0 topCapHeight:0]];

        UIViewController *initalViewController = [self.delegate initialViewController];
        [self configureViewController:initalViewController];

        [_slideNavigationController setViewControllers:[NSArray arrayWithObject:initalViewController] animated:NO];

        [self addChildViewController:_slideNavigationController];

        [self.view addSubview:_slideNavigationController.view];

        if ([self.delegate respondsToSelector:@selector(initialSelectedIndexPath)])
            [_tableView selectRowAtIndexPath:[self.delegate initialSelectedIndexPath] animated:NO scrollPosition:UITableViewScrollPositionTop];

    }

    #pragma mark Instance Methods

    - (void)configureViewController:(UIViewController *)viewController {

          UIButton *tempButton = [UIButton buttonWithType:UIButtonTypeCustom];
       [tempButton setFrame:CGRectMake(1, 1, 14, 30)]; // your Home Button Image width and height.
        [tempButton addTarget:self action:@selector(menuBarButtonItemPressed:) forControlEvents:UIControlEventTouchUpInside];
        [tempButton setImage:[UIImage imageNamed:@"ic_drawer.png"] forState:UIControlStateNormal];
        //[tempButton setImage:[UIImage imageNamed:@"twitterIcon.png"] forState:UIControlStateHighlighted];
        [viewController.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithCustomView:tempButton]];

    }

    - (void)menuBarButtonItemPressed:(id)sender {

        if (_slideNavigationControllerState == kSlideNavigationControllerStatePeeking) {

            [self slideInSlideNavigationControllerView];
            return;

        }

        UIViewController *currentViewController = [[_slideNavigationController viewControllers] objectAtIndex:0];

        if ([currentViewController conformsToProtocol:@protocol(SlideViewControllerSlideDelegate)] && [currentViewController respondsToSelector:@selector(shouldSlideOut)]) {


            if ([(id <SlideViewControllerSlideDelegate>)currentViewController shouldSlideOut]) {

                [self slideOutSlideNavigationControllerView];

            }


        } else {

            [self slideOutSlideNavigationControllerView];

        }

    }

    - (void)slideOutSlideNavigationControllerView {

        _slideNavigationControllerState = kSlideNavigationControllerStatePeeking;

        [UIView animateWithDuration:0.2 delay:0.0f options:UIViewAnimationOptionCurveEaseInOut  | UIViewAnimationOptionBeginFromCurrentState animations:^{

            _slideNavigationController.view.transform = CGAffineTransformMakeTranslation(260.0f, 0.0f);

        } completion:^(BOOL finished) {

            [_slideNavigationController.view addSubview:_overlayView];

        }];

    }

    - (void)slideInSlideNavigationControllerView {

        [UIView animateWithDuration:0.2 delay:0.0f options:UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionBeginFromCurrentState animations:^{

            _slideNavigationController.view.transform = CGAffineTransformIdentity;

        } completion:^(BOOL finished) {

            [self cancelSearching];

            _slideNavigationControllerState = kSlideNavigationControllerStateNormal;
            [_overlayView removeFromSuperview];

        }];

    }





    - (void)slideSlideNavigationControllerViewOffScreen {

        _slideNavigationControllerState = kSlideNavigationControllerStateSearching;

        [UIView animateWithDuration:0.2 delay:0.0f options:UIViewAnimationOptionCurveEaseInOut  | UIViewAnimationOptionBeginFromCurrentState animations:^{

            _slideNavigationController.view.transform = CGAffineTransformMakeTranslation(320.0f, 480.0f);

        } completion:^(BOOL finished) {

            [_slideNavigationController.view addSubview:_overlayView];

        }];

    }

    #pragma mark UITouch Logic


    - (void)cancelSearching {

        if (_slideNavigationControllerState == kSlideNavigationControllerStateSearching) {
            [_searchBar resignFirstResponder];
            _slideNavigationControllerState = kSlideNavigationControllerStateNormal;
            _searchBar.text = @"";
            [_tableView reloadData];
        }

    }

    #pragma mark SlideViewNavigationBarDelegate Methods

    - (void)slideViewNavigationBar:(SlideViewNavigationBar *)navigationBar touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

        [self touchesBegan:touches withEvent:event];

    }

    - (void)slideViewNavigationBar:(SlideViewNavigationBar *)navigationBar touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {

        [self touchesMoved:touches withEvent:event];

    }

    - (void)slideViewNavigationBar:(SlideViewNavigationBar *)navigationBar touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {

        [self touchesEnded:touches withEvent:event];

    }

    #pragma mark UINavigationControlerDelgate Methods 

    - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated {

        [self cancelSearching];

        if ([[navigationController viewControllers] count] > 1) {

            _slideNavigationControllerState = kSlideNavigationControllerStateDrilledDown;

        } else {

            _slideNavigationControllerState = kSlideNavigationControllerStateNormal;

        }

    }

    #pragma mark UITableViewDelegate / UITableViewDatasource Methods

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

        if (_slideNavigationControllerState == kSlideNavigationControllerStateSearching) {
            return [[self.delegate searchDatasource] count];
       } else {
            return [[[[self.delegate datasource] objectAtIndex:section] objectForKey:kSlideViewControllerSectionViewControllersKey] count];        
        }
    }

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

        if (_slideNavigationControllerState == kSlideNavigationControllerStateSearching) {
            return 1;
        } else {
            return [[self.delegate datasource] count];
        }
    }

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
    {
        static NSString *resuseIdentifier = @"SlideViewControllerTableCell";
        SlideViewControllerTableCell *cell = [tableView dequeueReusableCellWithIdentifier:resuseIdentifier];

        if (!cell) {

            cell = [[[SlideViewControllerTableCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:resuseIdentifier] autorelease];

        }



        NSDictionary *viewControllerDictionary = nil;

        if (_slideNavigationControllerState == kSlideNavigationControllerStateSearching) {
            viewControllerDictionary = [[self.delegate searchDatasource] objectAtIndex:indexPath.row];
        } else {
            viewControllerDictionary = [[[[self.delegate datasource] objectAtIndex:indexPath.section] objectForKey:kSlideViewControllerSectionViewControllersKey] objectAtIndex:indexPath.row];
        }

        cell.textLabel.text = [viewControllerDictionary objectForKey:kSlideViewControllerViewControllerTitleKey];

        if ([[viewControllerDictionary objectForKey:kSlideViewControllerViewControllerIconKey] isKindOfClass:[UIImage class]]) {
            cell.imageView.image = [viewControllerDictionary objectForKey:kSlideViewControllerViewControllerIconKey];
            //cell.imageView.image =[[]]
        } else {
            cell.imageView.image = nil;
        }
        UIView *v = [[[UIView alloc] init] autorelease];
        v.backgroundColor = [UIColor redColor];
        [cell setBackgroundColor:[UIColor clearColor]];
        cell.textLabel.textColor = [UIColor colorWithRed:190.0f/255.0f green:197.0f/255.0f blue:212.0f/255.0f alpha:1.0f];
        cell.textLabel.textColor = [UIColor colorWithRed:190.0f/255.0f green:197.0f/255.0f blue:212.0f/255.0f alpha:1.0f];
        //cell.textLabel.highlightedTextColor = self.textLabel.textColor;
        cell.textLabel.shadowColor = [UIColor colorWithRed:33.0f/255.0f green:38.0f/255.0f blue:49.0f/255.0f alpha:1.0f];
        cell.textLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
        cell.textLabel.backgroundColor = [UIColor clearColor];
        cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:12.0f];

        cell.imageView.clipsToBounds = YES;
        cell.imageView.contentMode = UIViewContentModeScaleAspectFit;


        NSString *strTemp = [NSString stringWithFormat:@"%@",[viewControllerDictionary objectForKey:kSlideViewControllerViewControllerTitleKey]];

    //    float height = [strTemp boundingRectWithSize:(CGSize)13.0 options:nil attributes:nil context:nil];
        float height = [strTemp sizeWithFont:[UIFont fontWithName:@"Helvetica" size:13.0] constrainedToSize:CGSizeMake(300, 30) lineBreakMode:NSLineBreakByWordWrapping].height;
        [cell.textLabel setNumberOfLines:0];
        [cell.textLabel setText:strTemp];
        [cell.textLabel setFrame:CGRectMake(0, 0, 160, height)];






        return cell;
    }

    -(IBAction)logout:(id)sender
    {
        [[DBSession sharedSession] unlinkAll];
        MainViewController *fc = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];

        [self.navigationController pushViewController:fc animated:YES];
        [fc release];

    }



    - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {

        if (_slideNavigationControllerState == kSlideNavigationControllerStateSearching)
            return nil;

        NSDictionary *sectionDictionary = [[self.delegate datasource] objectAtIndex:section];

        if ([sectionDictionary objectForKey:kSlideViewControllerSectionTitleKey]) {

            NSString *sectionTitle = [sectionDictionary objectForKey:kSlideViewControllerSectionTitleKey];

            if ([sectionTitle isEqualToString:kSlideViewControllerSectionTitleNoTitle]) {

                return nil;

            } else {

                return sectionTitle;

            }

        } else {

            return nil;

        }

    }

    - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {

        if (_slideNavigationControllerState == kSlideNavigationControllerStateSearching)
            return nil;

        NSString *titleString = [self tableView:tableView titleForHeaderInSection:section];

        if (!titleString)
            return nil;

        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 22.0f)];
        imageView.image = [[UIImage imageNamed:@"section_background"] stretchableImageWithLeftCapWidth:0.0f topCapHeight:0.0f];

        UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectInset(imageView.frame, 10.0f, 0.0f)];
        titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:12.0f];
        titleLabel.textAlignment = UITextAlignmentLeft;
        titleLabel.textColor = [UIColor colorWithRed:125.0f/255.0f green:129.0f/255.0f blue:146.0f/255.0f alpha:1.0f];
        titleLabel.shadowColor = [UIColor colorWithRed:40.0f/255.0f green:45.0f/255.0f blue:57.0f/255.0f alpha:1.0f];
        titleLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
        titleLabel.backgroundColor = [UIColor clearColor];
        titleLabel.text = titleString;
        [imageView addSubview:titleLabel];
        [titleLabel release];

        return [imageView autorelease];

    }


    - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {

        if (_slideNavigationControllerState == kSlideNavigationControllerStateSearching) {
            return 0.0f;
        }
        else if ([self tableView:tableView titleForHeaderInSection:section]) {
            return 22.0f;
        } else {
            return 0.0f;
        }
    }

    -(CGFloat)tableView:(UITableView*)tableView heightForFooterInSection:(NSInteger)section
    {
        if (section == 4) {
            return 40.0;
        }
        else {
            return 10.0;
        }
    }



    -(UIView*)tableView:(UITableView*)tableView viewForFooterInSection:(NSInteger)section
    {

        if(section == 4)
        {



           UIButton *logoutImage = [UIButton buttonWithType:UIButtonTypeCustom];
            [logoutImage setFrame:CGRectMake(35, 15, 150, 100)];
            [logoutImage setImage:[UIImage imageNamed:@"logoutbutton.PNG"] forState:UIControlStateNormal];
            [logoutImage addTarget:self action:@selector(logout:) forControlEvents:UIControlEventTouchUpInside];

        return [logoutImage autorelease];
        }
        else
        {
            return [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
        }

       //return [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];

    }


    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        NSLog(@"indexPath ==%d",indexPath.section);
        NSDictionary *viewControllerDictionary = nil;

        if (_slideNavigationControllerState == kSlideNavigationControllerStateSearching) {
            viewControllerDictionary = [[self.delegate searchDatasource] objectAtIndex:indexPath.row];
        } else {
            viewControllerDictionary = [[[[self.delegate datasource] objectAtIndex:indexPath.section] objectForKey:kSlideViewControllerSectionViewControllersKey] objectAtIndex:indexPath.row];
        }

        Class viewControllerClass = [viewControllerDictionary objectForKey:kSlideViewControllerViewControllerClassKey];
        NSString *nibNameOrNil = [viewControllerDictionary objectForKey:kSlideViewControllerViewControllerNibNameKey];
        UIViewController *viewController = [[viewControllerClass alloc] initWithNibName:nibNameOrNil bundle:nil];

        if ([self.delegate respondsToSelector:@selector(configureViewController:userInfo:)])
            [self.delegate configureViewController:viewController userInfo:[viewControllerDictionary objectForKey:kSlideViewControllerViewControllerUserInfoKey]];

        [self configureViewController:viewController];

        [_slideNavigationController setViewControllers:[NSArray arrayWithObject:viewController] animated:NO];
        [viewController release];

        [self slideInSlideNavigationControllerView ];


        if(indexPath.section == 4)
        {
            if (indexPath.row == 0){



                [[DBSession sharedSession] unlinkAll];
                MainViewController *fc = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];

                [self.navigationController pushViewController:fc animated:YES];
                [fc release];
            }
        }

    }







    #pragma mark UISearchBarDelegate Methods

    - (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar {

        if ([self.delegate respondsToSelector:@selector(configureSearchDatasourceWithString:)]) {

            [self slideSlideNavigationControllerViewOffScreen];

            [self.delegate configureSearchDatasourceWithString:searchBar.text];

            [_tableView reloadData];

        }

    }

    - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {

        if ([self.delegate respondsToSelector:@selector(configureSearchDatasourceWithString:)]) {

            [self.delegate configureSearchDatasourceWithString:searchBar.text];

            [_tableView reloadData];

        }

    }

    - (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {

        [self cancelSearching];

        [self slideOutSlideNavigationControllerView];

        [_tableView reloadData];

    }

    @end

ind the log says that:
2013-12-27 18:12:04.989 Skirr[1534:a0b] Application windows are expected to have a root view controller at the end of application launch
2013-12-27 18:12:45.918 Skirr[1534:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'
*** First throw call stack:
(
    0   CoreFoundation                      0x032745e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x021b88b6 objc_exception_throw + 44
    2   CoreFoundation                      0x03228316 -[__NSPlaceholderArray initWithObjects:count:] + 390
    3   CoreFoundation                      0x0324bce9 +[NSArray arrayWithObject:] + 73
    4   Skirr                               0x0000943d -[SlideViewController viewDidLoad] + 1597
    5   UIKit                               0x00e2d318 -[UIViewController loadViewIfRequired] + 696
    6   UIKit                               0x00e2d5b4 -[UIViewController view] + 35
    7   UIKit                               0x00e473e2 -[UINavigationController _startCustomTransition:] + 778
    8   UIKit                               0x00e540c7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688
    9   UIKit                               0x00e54cb9 -[UINavigationController __viewWillLayoutSubviews] + 57
    10  UIKit                               0x00f8e181 -[UILayoutContainerView layoutSubviews] + 213
    11  UIKit                               0x00d84267 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
    12  libobjc.A.dylib                     0x021ca81f -[NSObject performSelector:withObject:] + 70
    13  QuartzCore                          0x005622ea -[CALayer layoutSublayers] + 148
    14  QuartzCore                          0x005560d4 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
    15  QuartzCore                          0x00555f40 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
    16  QuartzCore                          0x004bdae6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
    17  QuartzCore                          0x004bee71 _ZN2CA11Transaction6commitEv + 393
    18  QuartzCore                          0x004bf544 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
    19  CoreFoundation                      0x0323c4ce __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    20  CoreFoundation                      0x0323c41f __CFRunLoopDoObservers + 399
    21  CoreFoundation                      0x0321a344 __CFRunLoopRun + 1076
    22  CoreFoundation                      0x03219ac3 CFRunLoopRunSpecific + 467
    23  CoreFoundation                      0x032198db CFRunLoopRunInMode + 123
    24  GraphicsServices                    0x034ce9e2 GSEventRunModal + 192
    25  GraphicsServices                    0x034ce809 GSEventRun + 104
    26  UIKit                               0x00d19d3b UIApplicationMain + 1225
    27  Skirr                               0x000056a2 main + 130
    28  libdyld.dylib                       0x06896725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 
    }

Thanks in advance

JohnWick
  • 241
  • 2
  • 13
  • 3
    Please can you provide the error that you get in the crash? – Popeye Dec 27 '13 at 11:46
  • Whey extra parenthesis after `@end`? – Bhumeshwer katre Dec 27 '13 at 11:50
  • @Bhumeshwerkatre I'm assuming typo because if that were there then it wouldn't even run in the simulator – Popeye Dec 27 '13 at 11:51
  • 2
    iPhone CrashLog? device type? ios version? – thorb65 Dec 27 '13 at 11:55
  • @Popeye, [_slideNavigationController setViewControllers:[NSArray arrayWithObject:initalViewController] animated:NO];(Thread1:signal SIGABRT) at this line and initialViewController have nil value instead in simulator it have. – JohnWick Dec 27 '13 at 12:19
  • @Bhumeshwerkatre, brother its not extra parenthesis its because of i have to mention my code in this column so i did – JohnWick Dec 27 '13 at 12:21
  • @thorb, there is no log simply crash device type iphone 4s and version iOS 7. – JohnWick Dec 27 '13 at 12:22
  • @Rahul There is an error message in the console and you can get a backtrace with the "bt" command. post them. – zaph Dec 27 '13 at 12:23
  • @thorb, libc++abi.dylib: terminating with uncaught exception of type NSException this is in log sorry little bit frusteded..... – JohnWick Dec 27 '13 at 12:24
  • @Rahul turn on exception breakpoints, run and after the crash click run a couple of times to get the full error message. – zaph Dec 27 '13 at 12:25
  • Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0] – JohnWick Dec 27 '13 at 12:25
  • Do the following https://developer.apple.com/library/ios/recipes/xcode_help-breakpoint_navigator/articles/adding_an_exception_breakpoint.html – Popeye Dec 27 '13 at 12:26
  • @Zaph, i did not get you what you wanna say...and in log there is a big line in there should i post it – JohnWick Dec 27 '13 at 12:28
  • Yes, add it to your question. When you breakpoint on an exception the full error message has not been displayed yet, you have to chick on the debugging run triangle a couple of times to get the entire error message to print. – zaph Dec 27 '13 at 12:30
  • @Popeye, there is no pop appear when i choose add exception breakpoint it simply make a breakpoint name All exceptions – JohnWick Dec 27 '13 at 12:31
  • All exceptions is what you want. Also have you run the Analyzer and corrected **all** warnings? – zaph Dec 27 '13 at 12:33
  • @Zaph ok i do it http://stackoverflow.com/questions/20800840/exception-could-not-understand-in-iphone – JohnWick Dec 27 '13 at 12:36
  • @Rahul You can edit your own question, add the error info to **this** question. – zaph Dec 27 '13 at 12:37
  • @Zaph, do you use skype please i have new to stack overflow and it not allow me to come on chat – JohnWick Dec 27 '13 at 12:43
  • No, I do not use Skype. – zaph Dec 27 '13 at 12:49
  • @Zaph, so any platform where i can send you my code? – JohnWick Dec 27 '13 at 12:51
  • Sorry, I do not have the time to fix code. Unfortunately it takes a lot of time studying how to write iOS code and use Xcode. There are many great resources on the web. Start with [NSHipster](http://nshipster.com), consider [NSScreencast](http://nsscreencast.com) (not free but well worth the price). – zaph Dec 27 '13 at 13:00
  • @Zaph,but you know why this is happen what is the reason behind this and in simulator app run properly and in device is not why? – JohnWick Dec 27 '13 at 13:04
  • @Zaph, I HAVE FOUND SOLUTION – JohnWick Dec 27 '13 at 13:06
  • @Rahul Add the solution to this question as an answer. – zaph Dec 27 '13 at 13:08
  • please post your answer so others can use it in future. Thanks – Maul Dec 27 '13 at 13:15
  • @rahul can you got the object `UIViewController *initalViewController = [self.delegate initialViewController];` ? i think `initalViewController` is null. – korat prashant Dec 27 '13 at 13:19

1 Answers1

0

Interpreting the error message:

The error occurred in the class: Skirr method: -[SlideViewController viewDidLoad] and the error was adding a nil object.

Look at that method and find a place where something is being added to an array.

zaph
  • 111,848
  • 21
  • 189
  • 228