【问题标题】:Presence of UITextField and Pixate Freestyle Crashes on iOS 9iOS 9 上存在 UITextField 和 Pixate Freestyle 崩溃
【发布时间】:2015-09-15 17:16:40
【问题描述】:

我所有包含UITextField 对象的视图控制器在模拟器中的 iOS 9 上都崩溃了:

-[UITextField preventStyling]: unrecognized selector sent to instance 0x7fa8b96d6330

Failed to set (styleClass) user defined inspected property on (UITextField): -[UITextField preventStyling]: unrecognized selector sent to instance 0x7fa8b96d6330

还有其他人在使用 Pixate Freestyle 时遇到过这种情况吗?有任何想法吗?我在 GitHub 存储库上记录了一个问题,但似乎没有人在监视这些问题:https://github.com/Pixate/pixate-freestyle-ios/issues/186

下面是完整的堆栈跟踪:

0   CoreFoundation                      0x000000010749cf65 __exceptionPreprocess + 165
1   libobjc.A.dylib                     0x0000000106f14deb objc_exception_throw + 48
2   CoreFoundation                      0x00000001074a558d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3   CoreFoundation                      0x00000001073f2d97 ___forwarding___ + 487
4   CoreFoundation                      0x00000001073f2b28 _CF_forwarding_prep_0 + 120
5   PilotPro                            0x000000010438a3c0 -[PXVirtualStyleableControl preventStyling] + 85
6   PilotPro                            0x000000010436a0fc +[PXStyleUtils updateStyleForStyleable:] + 83
7   PilotPro                            0x00000001043812d8 -[UIView(PXStyling) updateStyles] + 317
8   CoreFoundation                      0x000000010738b85c __invoking___ + 140
9   CoreFoundation                      0x000000010749df49 -[NSInvocation invokeUsingIMP:] + 217
10  UIKit                               0x0000000105d0d773 __workaround10030904InvokeWithTarget_block_invoke + 84
11  UIKit                               0x00000001056b5fe1 +[UIView _performSystemAppearanceModifications:] + 66
12  UIKit                               0x0000000105d0d70d workaround10030904InvokeWithTarget + 1053
13  UIKit                               0x0000000105d07995 applyInvocationsToTarget + 1864
14  UIKit                               0x0000000105d06aac +[_UIAppearance _applyInvocationsTo:window:matchingSelector:onlySystemInvocations:] + 1888
15  UIKit                               0x00000001056d8a36 __88-[UIView(Internal) _performUpdatesForPossibleChangesOfIdiom:orScreen:traverseHierarchy:]_block_invoke + 64
16  UIKit                               0x00000001056d89c0 -[UIView(Internal) _performUpdatesForPossibleChangesOfIdiom:orScreen:traverseHierarchy:] + 189
17  UIKit                               0x00000001056d88d6 -[UIView(Internal) _didChangeFromIdiomOnScreen:traverseHierarchy:] + 182
18  UIKit                               0x00000001056d7ea3 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1743
19  UIKit                               0x0000000105792b41 -[UIControl _didMoveFromWindow:toWindow:] + 68
20  UIKit                               0x00000001056d7b32 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 862
21  UIKit                               0x00000001056d7b32 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 862
22  UIKit                               0x00000001056ec7d0 -[UIScrollView _didMoveFromWindow:toWindow:] + 85
23  UIKit                               0x00000001056d7b32 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 862
24  UIKit                               0x00000001056d7b32 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 862
25  UIKit                               0x00000001056ec7d0 -[UIScrollView _didMoveFromWindow:toWindow:] + 85
26  UIKit                               0x00000001056d7b32 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 862
27  UIKit                               0x00000001056d7b32 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 862
28  UIKit                               0x00000001056cd106 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 155
29  UIKit                               0x00000001056cd005 -[UIView(Hierarchy) _postMovedFromSuperview:] + 544
30  UIKit                               0x00000001056daac3 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1967
31  UIKit                               0x0000000105a83212 -[UINavigationTransitionView transition:fromView:toView:] + 672
32  UIKit                               0x00000001057fd27d -[UINavigationController _startTransition:fromViewController:toViewController:] + 3262
33  UIKit                               0x00000001057fd879 -[UINavigationController _startDeferredTransitionIfNeeded:] + 890
34  UIKit                               0x00000001057fe67d -[UINavigationController __viewWillLayoutSubviews] + 57
35  UIKit                               0x000000010599663d -[UILayoutContainerView layoutSubviews] + 248
36  PilotPro                            0x00000001043a6825 callSuper0 + 55
37  PilotPro                            0x000000010438b259 -[PXUIView layoutSubviews] + 47
38  UIKit                               0x00000001056de11c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710
39  QuartzCore                          0x00000001053ab36a -[CALayer layoutSublayers] + 146
40  QuartzCore                          0x000000010539fbd0 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
41  QuartzCore                          0x000000010539fa4e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
42  QuartzCore                          0x00000001053941d5 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
43  QuartzCore                          0x00000001053c19f0 _ZN2CA11Transaction6commitEv + 508
44  QuartzCore                          0x00000001053c2154 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
45  CoreFoundation                      0x00000001073c89d7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
46  CoreFoundation                      0x00000001073c8947 __CFRunLoopDoObservers + 391
47  CoreFoundation                      0x00000001073bdebc CFRunLoopRunSpecific + 524
48  UIKit                               0x000000010562898d -[UIApplication _run] + 402
49  UIKit                               0x000000010562d676 UIApplicationMain + 171
50  PilotPro                            0x000000010417cf84 main + 132
51  libdyld.dylib                       0x000000010798892d start + 1

【问题讨论】:

  • 我的项目中出现同样的错误。如果您找到任何解决方案,请告诉我。
  • 我还没有找到解决办法。 :(

标签: ios objective-c pixate


【解决方案1】:

这是我的解决方案的复制和粘贴:https://github.com/Pixate/pixate-freestyle-ios/issues/192

大家好,

和其他人一样,当我升级到 Xcode 到 7 和 Mac OS X El capitan 时,我遇到了 PixateFreestyle 框架的几个问题。

经过几天的研究,我决定编译自己版本的 PixateFreestyle 框架以避免这个问题。

这里有我的版本:https://www.dropbox.com/s/9cz035h67y9x7fd/PixateFreestyle.framework.zip?dl=0

如果您将此框架添加到您的项目中,当您执行模拟器或创建启用了位码的存档时,一切都会像魅力一样工作。

如果您想从源代码构建自己的 PixateFreestyle 框架,请按照以下步骤操作:

  • 从 github 下载项目
  • 修复 callSuper1v 问题:#186
  • 使用自定义脚本构建通用框架
  • 在构建过程中添加位码支持 [可选]
  • 将生成的框架添加到您的项目中

问候。

【讨论】:

  • 这可能是我们所期望的一样好的修复,因为 Pixate 不再被积极开发。 :) 谢谢!
【解决方案2】:

我也遇到过这个问题,我的解决方案远非完美,但正在运行:D 从this 帖子中,我已经能够解决三个问题:preventStyling、playsNicelyWithGestures 和 _isInteractiveTextSelectionDisabled 选择器错误。此外,我必须再添加一个函数:requiresKeyEvents。 有了这个,问题就解决了:D

谢谢你:)

【讨论】:

    【解决方案3】:

    虽然不再支持 Pixate,但有一个名为 StylingKit 的新框架支持。 StylingKit 在后台使用 Pixate 的所有代码,因此您的所有方法应该仍然有效,并且不会遇到任何 iOS 9 问题。

    此规则的例外是任何 Pixate 静态方法,例如 [PixateFreestyle updateStylesForAllViews]。在这种情况下,您可以在 StylingKit.mStylingKit.h 文件中创建访问器方法以使用隐藏的 PixateFreestyle 函数。

    例如,如果您的项目依赖于通过 [PixateFreestyle updateStylesForAllViews] 更新 CSS 主题,您可以在 StylingKit.h 中创建一个新的方法声明,例如:

        @interface StylingKit : NSObject
    
            -(void)PixateUpdateStylesForAllViews;
            -(void)OtherHiddenPixateMethod;
    

    然后在StylingKit.m 文件中实现这些方法。

        @implementation StylingKit
    
            -(void)PixateUpdate
            {
                [PixateFreestyle updateStylesForAllViews];
            }
    
            -(void)OtherHiddenPixateMethod
            {
                //Your PixateFreeStyle code here
            }
    

    最后你可以从你的项目中调用这些方法

        [[StylingKit sharedKit] PixateUpdate];
        [[StylingKit sharedKit] OtherHiddenPixateMethod];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-15
      • 1970-01-01
      • 1970-01-01
      • 2015-12-29
      • 2015-12-16
      • 1970-01-01
      相关资源
      最近更新 更多