0

昨天,我下载了麻雀邮件应用程序,启动后立即崩溃。

生成以下崩溃日志:

Incident Identifier: [TODO]
CrashReporter Key:   [TODO]
Hardware Model:      iPhone4,1
Process:         Sparrow [64701]
Path:            /var/mobile/Applications/2D0B2A21-4BE0-4A1E-9119-B16FAA3A1572/Sparrow.app/Sparrow
Identifier:      com.sparrowmailapp.iphoneapp
Version:         507.54
Code Type:       ARM
Parent Process:  launchd [1]

Date/Time:       2013-01-14 23:57:46 +0000
OS Version:      iPhone OS 5.0.1 (9A406)
Report Version:  104

Exception Type:  SIGABRT
Exception Codes: #0 at 0x305e132c
Crashed Thread:  0

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: '-[UINavigationBar setShadowImage:]: unrecognized selector sent to instance 0x9b1e70'

问题是 UINavigationBar 中的属性“shadowImage”,它在 iOS 5 上不存在。

现在我正在尝试构建一个移动基板插件以避免崩溃,将缺失的属性添加到 UINavigationBar 并覆盖和以下代码:

#import <Foundation/Foundation.h>

@interface UINavigationBar(MyNavigationBar)
@property(nonatomic,retain) UIImage *shadowImage NS_AVAILABLE_IOS(6_0) UI_APPEARANCE_SELECTOR;
@end

%hook UINavigationBar

- (void)setShadowImage:(UIImage *)shadowImage forToolbarPosition:(id)topOrBottom {
    %log;
    //%orig;
}


- (void)setShadowImage:(UIImage *)shadowImage {
    %log;
    //%orig;
}

%end;

我不知道要正确设置 shadowImage 或 UI_APPEARANCE_SELECTOR。

有任何想法吗?谢谢

4

1 回答 1

0

天哪,这些方法应该是 shadowImage 的普通 setter/getter。

问题已解决。

于 2013-01-15T17:15:45.030 回答