0

please can anyone help me? I have next problem. I created custom keyboard in xcode and want to use the GCD to load gifs async in array. But when i do this my app crash. My code

@implementation KeyboardViewController 

in viewDidLoad ()

dispatch_queue_t myQueue = dispatch_queue_create("identifier", NULL);

    dispatch_async(myQueue, ^{

        @synchronized (self.gifsArray){
            @autoreleasepool {
                for (int i = 0; i < NUMBER_OF_GIFS; i++) {
                    FLAnimatedImage *gifImage = [[FLAnimatedImage alloc] initWithAnimatedGIFData:[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%i", i] ofType:@"gif"]]];
                    [self.gifsArray addObject:gifImage];
            }

        }
        }
    });
Wooble
  • 87,717
  • 12
  • 108
  • 131
  • Please show the console error message and a symbolicated stack trace of the crash. – Phillip Mills Oct 20 '14 at 12:08
  • If i run in simulator it will be fine and no crash. But When i run on device it crash. At first it show my keyboard during 1 or 2 seconds and then dismiss my keyboard and show standart. And nothing log in console. Only this - 2014-10-20 14:19:23.976 Keyboard[2840:189251] Failed to inherit CoreMedia permissions from 2189: (null) – Сергей Олейнич Oct 20 '14 at 12:39
  • I try to debuq and have Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. also I have this Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in may also be helpful. – Сергей Олейнич Oct 21 '14 at 13:30
  • Today I understood what happend. In my console i saw this message from didreicememorywarning: 2014-10-24 12:09:12.418 Keyboard[4633:438239] Received memory warning. 2014-10-24 12:09:12.429 Keyboard[4633:438239] MYKEYBOARD What can I do with this? Can you help me please? – Сергей Олейнич Oct 24 '14 at 09:12

0 Answers0