title: SCLAlertView in background thread
body: <p>I am trying to display an SCLAlertView in my app, but I am getting this error:</p>
  
  <pre><code>Thread 1: EXC_BAD_ACCESS (code=EXC_1386_GPFLT)
  </code></pre>
  
  <p>on this line <code>[keyWindow.layer renderInContext:context];</code></p>
  
  <p>I am creating the alert after I call one of my parse cloud code functions. I have read that renderInContext should not be called in a background thread, but I have this exact same code in a different view controller (also after I call a cloud code function), and the alert displays perfectly.</p>
  
  <p>Also, if I display and hide a regular UIAlertView immediately before I show this one, the SCLAlertView shows without a problem, but the view behind it is a solid white. Why is this happening? Is UIAlertView somehow breaking out of the background thread?</p>
  
  <p>I have tried displaying the SCLAlertView in a background thread as suggested here: <a href="https://stackoverflow.com/questions/15135208/objective-c-renderincontext-crash-on-background-thread">objective c renderInContext crash on background thread</a> but the app still crashed.</p>
  
  <p>Here is my code to display the alert:</p>
  
  <pre><code>[PFCloud callFunctionInBackground:@"canWeStart"
                             withParameters:@{@"inviteId": self.selectedObject.objectId,
                                              @"gameType": [[self.selectedObject objectForKey:@"GameType"] objectForKey:@"type"]}
                                      block:^(NSArray *startStuff, NSError *error) {
                                          if (!error) {
  
                                              NSNumber *canStart = startStuff[0];
  
                                              BOOL startBool = [canStart boolValue];
  
                                              if(startBool)
                                              {
                                                 //Stuff
  
                                              }
                                              else
                                              {
  
                                                  //If I show this first, my alert shows perfectly.
                                                  UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Others" message:@"Need to accept" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
                                                  [alert show];
  
                                                  [alert dismissWithClickedButtonIndex:0 animated:NO];
  
                                                  SCLAlertView *alert = 
  
  [[SCLAlertView alloc] init];
  
          alert.backgroundType = Blur;
  
          //button.layer.borderWidth = 2.0f;
  
          [alert setTitleFontFamily:@"Alba" withSize:18.0f];
  
          [alert setBodyTextFontFamily:@"Arista 2.0" withSize:14.0f];
  
          [alert setButtonsTextFontFamily:@"Arista 2.0 Light" withSize:14.0f];
  
          alert.customViewColor = [UIColor pxColorWithHexValue:@"2b3355"];
  
          alert.backgroundViewColor = [UIColor whiteColor];
  
          [alert showNotice:self.navigationController title:@"Invite Accepted" subTitle:@"Others still need to accept the invite, then the game will begin!" closeButtonTitle:@"Ok" duration:0.0f];
  
                                                  }
  
                                              }
  
                                          }];
  </code></pre>