Thursday, December 1, 2011

Sharekit, ios5, and parentviewcontroller

In iOS 5 the parentviewcontroller no longer works.  To fix this, replace the - (void)hideCurrentViewControllerAnimated:(BOOL)animated method in SHK.m.  Code is below and was found on:
http://www.nimblekit.com/forum/viewtopic.php?f=13&t=2694&start=10



 - (void)hideCurrentViewControllerAnimated:(BOOL)animated 

 { 

   if (isDismissingView) 

    return; 

   if (currentView != nil) 

   { 

    if ([[[UIDevice currentDevice] systemVersion] intValue] < 5) { 

      // Dismiss the modal view 

      if ([currentView parentViewController] != nil) 

      { 

       self.isDismissingView = YES; 

       [[currentView parentViewController] dismissModalViewControllerAnimated:animated]; 

      } 

      else 

       self.currentView = nil; 

    } else { 

      // Dismiss the modal view 

      if ([currentView presentingViewController] != nil) 

      { 

       self.isDismissingView = YES; 

       [[currentView presentingViewController] dismissModalViewControllerAnimated:animated]; 

      } 

      else 

       self.currentView = nil; 

    } 

   } 

 }  

No comments:

Post a Comment