ShareKit method swizzling in Lion / Xcode 4.3.1?

天大地大妈咪最大 提交于 2019-12-06 07:30:49

I have never experienced method swizzling related errors on even on newest XCode and iOS SDK. I use ShareKit 2.0. Though method swizzling is a thing to be avoided in my opinion.

The method swizzled is viewDidDisappear if I remember well. Look what it does. On iOS 5 you can achieve the same using completion block in - (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion.

Just change the way you dismiss the viewController in - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error might be enough.

This is just an idea, how you might get rid of method swizzle.

The swizzling is only being used for email sharing. Use MFMailComposeViewController yourself, and strip the swizzling code out of ShareKit (it's in SHK.m).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!