0

我在使用 iPhone 的 ShareKit 时遇到了一些问题。我有我需要的一切(主要是 Twitter、Facebook 和电子邮件),非常适合发送 URL。然而,在我的应用程序的另一部分,我正在尝试实现共享少量文本的功能。当我在分享此文本时尝试打开 Facebook 时,它会快速打开 Facebook 屏幕然后消失。此外,当我尝试共享文本时,应用程序会定期崩溃,但绝不会因为 URL 崩溃。这对我来说似乎很奇怪。

我对崩溃日志和调试之类的事情不是很有经验,但是如果有人可以在应用程序崩溃时将我引导到 xcode 提供的信息,这些信息可能会为那些专业程序员提供帮助,我一定会提供。

编辑:我只是想说我将 SHConfig 文件复制到示例项目中,并且从那里一切似乎都正常,所以它一定是我的代码有问题。这是崩溃后显示的内容:

#0  0x028f0903 in objc_msgSend
#1  0x07540f70 in ??
#2  0x0276bf29 in __CFXNotificationPost_old
#3  0x026eb26a in _CFXNotificationPostNotification
#4  0x0019ec8a in -[NSNotificationCenter postNotificationName:object:userInfo:]
#5  0x007c11b7 in -[UIInputViewTransition postNotificationsForTransitionStart]
#6  0x007c1651 in -[UIPeripheralHost(UIKitInternal) executeTransition:]
#7  0x007b8728 in -[UIPeripheralHost(UIKitInternal) setInputViews:]
#8  0x00507403 in -[UIResponder(UIResponderInputViewAdditions) reloadInputViews]
#9  0x005079d0 in -[UIResponder becomeFirstResponder]
#10 0x0011204e in -[SHKFormFieldCell setSelected:animated:] at SHKFormFieldCell.m:116
#11 0x004b29cb in -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:]
#12 0x004a924d in -[UITableView selectRowAtIndexPath:animated:scrollPosition:]
#13 0x0011051a in -[SHKFormController viewDidAppear:] at SHKFormController.m:122
#14 0x004f2a5a in -[UINavigationController viewDidAppear:]
#15 0x006d827f in -[UIWindowController transitionViewDidComplete:fromView:toView:]
#16 0x004c8905 in -[UITransitionView notifyDidCompleteTransition:]
#17 0x0046f499 in -[UIViewAnimationState sendDelegateAnimationDidStop:finished:]
#18 0x0046f32b in -[UIViewAnimationState animationDidStop:finished:]
#19 0x047a6db0 in run_animation_callbacks
#20 0x047a6c6f in CA::timer_callback
#21 0x02774f73 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
#22 0x027765b4 in __CFRunLoopDoTimer
#23 0x026d2dd9 in __CFRunLoopRun
#24 0x026d2350 in CFRunLoopRunSpecific
#25 0x026d2271 in CFRunLoopRunInMode
#26 0x02f7e00c in GSEventRunModal
#27 0x02f7e0d1 in GSEventRun
#28 0x0044daf2 in UIApplicationMain
#29 0x00002690 in main at main.m:15
4

2 回答 2

1

嘿 Rob,尝试使用以下方法查找崩溃发生的位置: 如何向 objc_exception_throw 添加断点?

然后发回导致崩溃的对象/方法。

您可能还想尝试将您的 SHKConfig.h 文件从您的项目复制到 ShareKit 中提供的示例项目中,以查看崩溃是否仍然发生。如果是,那么这是 Sharekit 的问题,如果不是,则问题出在您自己的应用程序中。

于 2010-10-04T23:23:54.170 回答
1

我找到了问题的根源,但不知道如何解决我想要做的事情。我试图从 UIAlertView 中的按钮启动 ShareKit。显然,Sharekit 需要从屏幕上的一个简单按钮或 UIActionView 启动。我使用了 UIActionView,现在它可以工作了。

于 2010-10-11T17:45:17.673 回答