0

I need help with the above-mentioned error. My project is using AsyncDisplayKit and I am getting the error above in the _ASDisplayLayer.mm file line 104 in the method

- (void)setNeedsLayout
{
    ASDisplayNodeAssertMainThread();//line 104 where error is occuring
    [super setNeedsLayout];
}

I don't know how to solve this problem as I am new to the library and I am just rerunning a previous developer's work. Full error stack is: * Assertion failure in -[_ASDisplayLayer setNeedsLayout], /Users/.../Desktop/.../Pods/AsyncDisplayKit/AsyncDisplayKit/Details/_ASDisplayLayer.mm:104 2016-03-16 00:17:08.951 DanceRockIt[408:168719] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '' *** First throw call stack: (0x252fa2eb 0x24ac6dff 0x252fa1c1 0x25ad0d3b 0x27f519 0x2755f93b 0x2755f3d9 0x2756240b 0x2758f1f5 0x2949954b 0x297c4525 0x294b3a69 0x294f9e2d 0x2956c68d 0x2956d473 0x2956b935 0x345515 0x345259 0x12abcd 0x106ccbf 0x10775c3 0x106fefb 0x1079017 0x1078909 0x25030e0d 0x250309fc) libc++abi.dylib: terminating with uncaught exception of type NSException

saintjab
  • 1,626
  • 20
  • 31

1 Answers1

1

Something call your setNeedsLayout code from background thread. You must find this place and move to GUI Thread (aka main thread).

for example:

 dispatch_async(dispatch_get_main_queue(), ^{
     [self.titleTextNode setNeedLayout];
 });
Bimawa
  • 3,535
  • 2
  • 25
  • 45
  • Thanks @Bimawa. I couldn't find any reference to setNeedLayout in my ViewController file so what I did is to put the line giving error in the main_queue – saintjab Mar 21 '16 at 15:54
  • @saintjab u must research ur code and find something what u send to background, or call me on screenHero: bimawa@gmail.com , or give to me ur email for invite, i have a little bit time for help. – Bimawa Mar 21 '16 at 16:04