2015-04-03 102 views
3

我沒有定義斷點,分別刪除了所有現有的斷點。儘管如此,它停止在一個特定的點,我不明白。它不在我的代碼中。它在線程上更低級別?看截圖。XCode中線程的斷點

我該如何避免這種情況?

enter image description here

附加信息/代碼:

這似乎停留在 「LastselectedObject2」 的吸氣

0x10b5a0efc <Prototypes.Timelineview.LastselectedObject2.getter : Prototypes.DisplayedObject+12>: movq 0x76215(%rip), %rax  ; direct field offset for Prototypes.Timelineview.LastselectedObject2 

它被迫與下面的代碼:

println("touchesBegan at start . LastObject :" + self.timelineview.LastselectedObject2.sTitle); 

LastselectedObject2在timelineview類中定義:

class Timelineview: UIView { 

    var LastselectedObject2:DisplayedObject; 
... 
... 

的Class DisplayedObject看起來如下:

class DisplayedObject: NSObject, NSCopying { 

    var iType:Int = 0; // 0 = Phase ; 1 = Event 
    var X1:Int = 0; 
    var Y1:Int = 0; 
    var X2:Int = 0; 
    var Y2:Int = 0; 
    var sWikiID:String = ""; 
    var sTitle:String = ""; 
    var sImage:String = ""; 

    var bclickable:Bool = true; 

    func copyWithZone(zone: NSZone) -> AnyObject { 

     let a=DisplayedObject(iType: iType, X1: X1, Y1: Y1, X2: X2, Y2: Y2, sWikiID: sWikiID, sTitle: sTitle, sImage: sImage, bclickable: bclickable); 

     //let theCopy = self.dynamicType(iType: iType, X1: X1, Y1: Y1, X2: X2, Y2: Y2, sWikiID: sWikiID, sTitle: sTitle, sImage: sImage, bclickable: bclickable); 
     //theCopy.color = self.color 
     return a 

     //return DisplayedObject(); 
    } 

    override init(){ 
     //self.iType=iType; 
    } 

    init(iType:Int, X1:Int,Y1:Int,X2:Int,Y2:Int, sWikiID:String, sTitle:String, sImage:String, bclickable:Bool){ 
     self.iType=iType; 
     self.X1=X1; 
     self.Y1=Y1; 
     self.X2=X2; 
     self.Y2=Y2; 
     self.sWikiID=sWikiID; 
     self.sTitle=sTitle; 
     self.sImage=sImage; 
     self.bclickable=bclickable; 
    } 

    func empty(){ 
     X1 = 0; 
     iType = 0; // 0 = Phase ; 1 = Event 
     X1 = 0; 
     Y1 = 0; 
     X2 = 0; 
     Y2 = 0; 
     sWikiID = ""; 
     sTitle = ""; 
     sImage = ""; 
    } 
} 
+1

請分享一些代碼!它與斷點無關,因爲它的代碼。 – itsji10dra 2015-04-03 07:54:52

+0

謝謝!我添加了相關的代碼。 – 2015-04-03 08:02:28

回答

0

我曾與CoreData對象類似的問題,看到我的帖子:Swift: Breakpoint in CoreData Library

儘量使該類可見的ObjectiveC:

@objc(DisplayedObject) 
class DisplayedObject: NSObject, NSCopying { 
    ... 
} 
+0

謝謝,但@object(DisplayedObject)沒有幫助。 – 2015-04-03 10:06:40

+0

應該是'@objc(DisplayedObject)',而不是'@object(DisplayedObject)' – zisoft 2015-04-03 10:07:45

+0

對不起。我錯在這裏在stackoverflow,但用@objc(DisplayedObject)測試。它仍停在同一點。 – 2015-04-03 10:21:18