ShareKit
ShareKit copied to clipboard
IOS 5 Cancel Button
In ios 5 not working Cancel Button from views when load twitter view!
Any idea?!?!?!
Sorry for my english!
Hi,
I have the same issue as well. The cancel button does not work when authorizing for twitter using oAuth.
Yes, same here...
Same problem. Sugestions?
Hey everyone,
I've fixed the issue but due to iOS5 being under NDA I'm unable to push out my fix. I will update my fork with the fix once the NDA for 5.0 is lifted though.
-David
This link helped me fix it pretty easily (in SHK.m). I'm OK with posting it because you'd have to be under the NDA to read it anyway: https://devforums.apple.com/message/451045
Same problem.
Could you say more btedev ?
I don't want to upset the NDA police but I'll be glad to discuss privately. Just message me directly through my GitHub profile.
When editing the SHK.m and applying the accepted answer code on https://devforums.apple.com/message/451045 the problem is solved. Thx.
What was the solution to this? I looked through the code above, but I wasn't able to get the button to work again.
Thanks!
Now that the NDA is lifted, I just changed the two instances of [[currentView parentViewController] dismissModalViewControllerAnimated:YES] in SHK.m to [currentView dismissModalViewControllerAnimated:YES].
This gist is my SHK.m: https://gist.github.com/1281191
Great, I appreciate it.
Great, works perfect for iOS5, but now I'm getting an EXC_BAD_ACCESS crash on iOS 4:
Debugger points to: [currentView dismissModalViewControllerAnimated:animated];
This needs to have detection on whether it's IOS5 or not to check whether it should be [[currentView parentViewController] dismissModalViewControllerAnimated:YES] or [currentView dismissModalViewControllerAnimated:YES] because it's probably not liking the reference.
After more testing, it appears that this crash only happens in the iOS 4.3 simulator. It works fine on an iPhone 4 running iOS 4.3. Strange.
Here's what i did:
if ([currentView respondsToSelector:@selector(presentingViewController)]) [[currentView presentingViewController] dismissViewControllerAnimated:YES completion:NO]; else [[currentView parentViewController] dismissModalViewControllerAnimated:YES];
@corvino 's fix is working perfectly here. Thanks!! ;)
Working here too. Thanks a lot!
Working great ! Thank you !
Thanks @corvino for the patch!
it works perfect, thank you!!!
Thank you so much!
Here's what I did for having it runnable on ios5 and ios4. // Dismiss the modal view if ([currentView parentViewController] != nil) { self.isDismissingView = YES; [[currentView parentViewController] dismissModalViewControllerAnimated:animated]; } else if([currentView respondsToSelector:@selector(presentingViewController)]) { self.isDismissingView = YES; [[currentView presentingViewController] dismissModalViewControllerAnimated:animated]; } else { self.currentView = nil; }
also, because the delegate doesn't work for static functions, I modified those two functions to be(SHKActionSheet.xx) :
- (SHKActionSheet *)actionSheetForType:(SHKShareType)type;
- (SHKActionSheet *)actionSheetForItem:(SHKItem *)i;
parentViewController
Prior to iOS 5.0, if a view did not have a parent view controller and was being presented modally, the view controller that was presenting it would be returned. This is no longer the case. Use the presentingViewController property to access the presenting view controller.
I'm replace parentViewController with presentingViewController and all will be ok
thnx Magnat12 - replacing parentViewController with presentingViewController works in my case!
still not working for me in iOS5.1 (using ARC w/ -fno-objc-arc)
It looks like CurrentView in SHK isn't getting set correctly
to all: better way now is use new version of ShareKit: https://github.com/ShareKit/ShareKit Where added iOS5 support, Twitter framework in iOS5 and many other improvements and bug fixed
Thanks @btedev It works
@corvino Thank you very much! Works perfectly!
having same issue as mclark4386 ... ? any updates ?
i have debug and found the issue you need to add this code in SHK.m file in hideCurrentViewControllerAnimated function line no 183
if ([currentView parentViewController] != nil) { self.isDismissingView = YES; [currentView dismissModalViewControllerAnimated:YES]; //[[currentView parentViewController] dismissModalViewControllerAnimated:animated]; }
else
{
[currentView dismissModalViewControllerAnimated:YES];
self.currentView = nil;
}
I have added just one line in else part previously it was just else { self.currentView = nil; }
@corvino: thank you a lot.
thanks for all of you.. I hope I can serve all of you some time..