App stürzt ab - CALayerInvalidGeometry

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • App stürzt ab - CALayerInvalidGeometry

    Hi zusammen,

    im Simulator stürzt mein App nicht ab, aber sobald ich es auf dem iphone laufen lasse, stürzt es mir mit folgendem Fehler ab:

    Quellcode

    1. *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan 0]'
    2. *** Call stack at first throw:
    3. (
    4. 0 CoreFoundation 0x32f4e64f __exceptionPreprocess + 114
    5. 1 libobjc.A.dylib 0x33391c5d objc_exception_throw + 24
    6. 2 CoreFoundation 0x32f4e491 +[NSException raise:format:arguments:] + 68
    7. 3 CoreFoundation 0x32f4e4cb +[NSException raise:format:] + 34
    8. 4 QuartzCore 0x35acc61d _ZL18CALayerSetPositionP7CALayerRKN2CA4Vec2IdEEb + 140
    9. 5 QuartzCore 0x35acc58b -[CALayer setPosition:] + 38
    10. 6 QuartzCore 0x35acc4d7 -[CALayer setFrame:] + 390
    11. 7 UIKit 0x329dc455 -[UIView(Geometry) setFrame:] + 188
    12. 8 Baseball 0x00058aeb -[ErgebnisViewController loadScrollViewWithPage:] + 466
    13. 9 Baseball 0x00058559 -[ErgebnisViewController viewWillAppear:] + 932
    14. 10 UIKit 0x32a18301 -[UINavigationController viewWillAppear:] + 220
    15. 11 UIKit 0x32a4b233 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 154
    16. 12 UIKit 0x32a4b18d -[UITabBarController transitionFromViewController:toViewController:] + 32
    17. 13 UIKit 0x32a4aa33 -[UITabBarController _setSelectedViewController:] + 186
    18. 14 UIKit 0x32acfceb -[UITabBarController setSelectedViewController:] + 14
    19. 15 UIKit 0x32acfbe7 -[UITabBarController _tabBarItemClicked:] + 226
    20. 16 CoreFoundation 0x32ebe571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 24
    21. 17 UIKit 0x329f3ec9 -[UIApplication sendAction:to:from:forEvent:] + 84
    22. 18 UIKit 0x329f3e69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32
    23. 19 UIKit 0x32acfa8b -[UITabBar _sendAction:withEvent:] + 270
    24. 20 CoreFoundation 0x32ebe571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 24
    25. 21 UIKit 0x329f3ec9 -[UIApplication sendAction:to:from:forEvent:] + 84
    26. 22 UIKit 0x329f3e69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32
    27. 23 UIKit 0x329f3e3b -[UIControl sendAction:to:forEvent:] + 38
    28. 24 UIKit 0x329f3b8d -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 356
    29. 25 UIKit 0x32a2dbd9 -[UIControl sendActionsForControlEvents:] + 16
    30. 26 UIKit 0x32be28d9 -[UITabBar(Static) _buttonDownDelayed:] + 48
    31. 27 Foundation 0x33e8f6d5 __NSFireDelayedPerform + 368
    32. 28 CoreFoundation 0x32f25a47 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 14
    33. 29 CoreFoundation 0x32f27ecb __CFRunLoopDoTimer + 850
    34. 30 CoreFoundation 0x32f28845 __CFRunLoopRun + 1088
    35. 31 CoreFoundation 0x32eb8ec3 CFRunLoopRunSpecific + 230
    36. 32 CoreFoundation 0x32eb8dcb CFRunLoopRunInMode + 58
    37. 33 GraphicsServices 0x33a2141f GSEventRunModal + 114
    38. 34 GraphicsServices 0x33a214cb GSEventRun + 62
    39. 35 UIKit 0x32a05d69 -[UIApplication _run] + 404
    40. 36 UIKit 0x32a03807 UIApplicationMain + 670
    41. 37 Baseball 0x000028e7 main + 70
    42. 38 Baseball 0x0000289c start + 40
    43. )
    44. terminate called after throwing an instance of 'NSException'
    Alles anzeigen



    Der Fehler passiert beim aufruf eines Scrollview in einer Tabbar
  • jetzt weiß ich, dass die location ungütlich ist, aber nicht genau wo ich suchen muss, ich hatte so einen fehler noch nicht, deshalb die Frage
    Ich weiß leider nicht genau an welcher stelle dieser fehler auftritt. Bzw. wie dieser Fehler entsteht!
  • ne, Division durch 0 findet nicht statt:

    Quellcode

    1. - (void)loadScrollViewWithPage:(int)page {
    2. NSLog(@"startErg %i", [scrollView retainCount]);
    3. if (page < 0) return;
    4. if (page >= eNumberOfPages) return;
    5. // replace the placeholder if necessary
    6. Ergebnisse *controller = [viewControllers objectAtIndex:page];
    7. if ((NSNull *)controller == [NSNull null]) {
    8. controller = [[[Ergebnisse alloc] initWithPageNumber:page] initWithNibName:@"Ergebnisse" bundle:nil];
    9. [viewControllers replaceObjectAtIndex:page withObject:controller];
    10. [controller release];
    11. }
    12. // add the controller's view to the scroll view
    13. if (nil == controller.view.superview) {
    14. CGRect frame = scrollView.frame;
    15. frame.origin.x = frame.size.width * page;
    16. frame.origin.y = 0;
    17. controller.view.frame = frame;
    18. [scrollView addSubview:controller.view];
    19. }
    20. }
    Alles anzeigen
  • Dem Aufrufstack der Exception zu Folge kommt er aber daher. Es kann natürlich auch an einer nicht initialisierten Variable liegen. Anscheinend ist es ja eine X- oder Y-Koordinate. Setze doch mal einen Breakpoint in die Methode und gehe schrittweise durch den Code. Damit kannst Du die genaue Absturzstelle ermitteln, falls sie Dir Xcode nicht sowieso schon anzeigt.
    „Meine Komplikation hatte eine Komplikation.“
  • Das passiert dann wenn die custom cell befüllt werden soll aber schon released ist. zumindest in meinem fall.
    _____________________________
    Alle Angaben ohne Gewähr :)

    On the internet you can be anything you want. It's strange that so many people choose to be stupid.


    Superbientem animus prosternet