Swift App正在崩溃,同时对时间进行排序

时间:2015-12-23 07:57:52

标签: swift crashlytics

有时我的应用在遇到Code Below中显示的代码段时崩溃。

以下代码

//[Custom Time Sorting method Desc for logging Display]
func sorterForTimeDesc(first:Logger, second:Logger) -> Bool {

    let time1 = first.logTime as String
    let time2 = second.logTime as String

    return time1>time2
}

错误

Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x30000000139099d8

0  TabletPLUS                     0x1000941e8 XMLParser.sorterForTimeDesc(Logger, second : Logger) -> Bool (XMLParser.swift:854)

1  TabletPLUS                     0x10009d428 partial apply (XMLParser.swift)

2  TabletPLUS                     0x1000a4660 specialized _siftDown<A where ...> (inout A, A.Index, Range<A.Index>, inout (A.Generator.Element, A.Generator.Element) -> Bool) -> () (XMLParser.swift)

3  TabletPLUS                     0x1000a0dc0 specialized _introSortImpl<A where ...> (inout A, Range<A.Index>, inout (A.Generator.Element, A.Generator.Element) -> Bool, Int) -> () (XMLParser.swift)

4  TabletPLUS                     0x1000a0d00 specialized _introSortImpl<A where ...> (inout A, Range<A.Index>, inout (A.Generator.Element, A.Generator.Element) -> Bool, Int) -> () (XMLParser.swift)

5  TabletPLUS                     0x1000a0cd8 specialized _introSortImpl<A where ...> (inout A, Range<A.Index>, inout (A.Generator.Element, A.Generator.Element) -> Bool, Int) -> () (XMLParser.swift)

6  TabletPLUS                     0x1000a0d00 specialized _introSortImpl<A where ...> (inout A, Range<A.Index>, inout (A.Generator.Element, A.Generator.Element) -> Bool, Int) -> () (XMLParser.swift)

7  TabletPLUS                     0x1000a0cd8 specialized _introSortImpl<A where ...> (inout A, Range<A.Index>, inout (A.Generator.Element, A.Generator.Element) -> Bool, Int) -> () (XMLParser.swift)

8  TabletPLUS                     0x1000a0d00 specialized _introSortImpl<A where ...> (inout A, Range<A.Index>, inout (A.Generator.Element, A.Generator.Element) -> Bool, Int) -> () (XMLParser.swift)

9  TabletPLUS                     0x1000a0cd8 specialized _introSortImpl<A where ...> (inout A, Range<A.Index>, inout (A.Generator.Element, A.Generator.Element) -> Bool, Int) -> () (XMLParser.swift)

10 TabletPLUS                     0x1000a0d00 specialized _introSortImpl<A where ...> (inout A, Range<A.Index>, inout (A.Generator.Element, A.Generator.Element) -> Bool, Int) -> () (XMLParser.swift)

11 TabletPLUS                     0x1000a0cd8 specialized _introSortImpl<A where ...> (inout A, Range<A.Index>, inout (A.Generator.Element, A.Generator.Element) -> Bool, Int) -> () (XMLParser.swift)

12 TabletPLUS                     0x1000a0d00 specialized _introSortImpl<A where ...> (inout A, Range<A.Index>, inout (A.Generator.Element, A.Generator.Element) -> Bool, Int) -> () (XMLParser.swift)

13 TabletPLUS                     0x1000a0cd8 specialized _introSortImpl<A where ...> (inout A, Range<A.Index>, inout (A.Generator.Element, A.Generator.Element) -> Bool, Int) -> () (XMLParser.swift)

14 TabletPLUS                     0x1000a0d00 specialized _introSortImpl<A where ...> (inout A, Range<A.Index>, inout (A.Generator.Element, A.Generator.Element) -> Bool, Int) -> () (XMLParser.swift)

15 TabletPLUS                     0x1000a0cd8 specialized _introSortImpl<A where ...> (inout A, Range<A.Index>, inout (A.Generator.Element, A.Generator.Element) -> Bool, Int) -> () (XMLParser.swift)

16 TabletPLUS                     0x1000a0694 specialized MutableCollectionType<A where ...>.(sortInPlace<A where ...> (inout A) -> ((A.Generator.Element, A.Generator.Element) -> Bool) -> ()).(closure #1) (XMLParser.swift)

17 TabletPLUS           0x10009d5d8             _TPA__TTSg5GSaC10TabletPLUS6Logger_GSaS0__Ss21MutableCollectionTypeSs_GVSs17IndexingGeneratorGSaS0___GS2_GSaS0___Ss13GeneratorTypeSs_S0__SiSiSs21RandomAccessIndexTypeSs_SiSiSs18_SignedIntegerTypeSs_SiSiSs33_BuiltinIntegerLiteralConvertibleSs_SiSiSs16SignedNumberTypeSs_SiSiS6_Ss_Si_GVSs10ArraySliceS0__GS8_S0__Ss9IndexableSsGS8_S0__Ss12SequenceTypeSs_GS2_GS8_S0___GS2_GS8_S0___S3_Ss_S0__SiSiSs16ForwardIndexTypeSs_SiSiS5_Ss_SiSiS6_Ss_Si_GS8_S0___S0__S0____TTRGRq_Ss21MutableCollectionTypeqq_Ss16MutableIndexable5IndexSs21RandomAccessIndexType_XFo_dGVSs20UnsafeMutablePointerqqq_Ss14CollectionType9GeneratorSs13GeneratorType7Element_dSi_dT_zoPSs9ErrorType__XFo_dGS2_qqq_S3_9GeneratorS4_7Element_dSi_iT_zoPS5___ (XMLParser.swift)


18 TabletPLUS                     0x10009d680   _TPA__TTSg5C10TabletPLUS6Logger_T____TFFSa42_withUnsafeMutableBufferPointerIfSupportedu__rFRGSaq__FzFzTGVSs20UnsafeMutablePointerq__Si_qd__GSqqd___U_FzRGVSs26UnsafeMutableBufferPointerQd___Q_ (XMLParser.swift)

19 TabletPLUS                     0x1000a5128 specialized Array.withUnsafeMutableBufferPointer<A><B>((inout UnsafeMutableBufferPointer<A>) throws -> B) throws -> B (XMLParser.swift)

20 TabletPLUS                     0x100093f18 XMLParser.getLogValueFromXml(String) -> Audit (XMLParser.swift)

21 TabletPLUS                     0x1000cdc44 ActivityLogController.viewDidLoad() -> () (ActivityLogController.swift:77)

22 TabletPLUS                     0x1000ce2c4 @objc ActivityLogController.viewDidLoad() -> () (ActivityLogController.swift)

0 个答案:

没有答案