2016-03-03 46 views
-1

我在應用程序中有時會出現此錯誤。我打印的對象,並得到這個:集合<__ NSCFDictionary:0x15a2fae0>在枚舉時發生了變異

(lldb) po 0x15a2fae0 
{ 
    "0x15d8bcd0.posErrorMarker{id: 4558}" = <00803b44 00000000 0000f03f 00007b43 00000000 0000f03f>; 
    "0x15d8baf0.posErrorMarker{id: 4554}" = <00007b43 00000000 0000f03f>; 
    "0x15d8aad0.negError{id: 4525}" = <00803b44 00000000 0000f03f 00007b43 00000000 0000f03f>; 
    "0x15a3f620.marker{id: 4353}" = <00007b43 00000000 0000f03f>; 
    "0x15d8bab0.posErrorMarker{id: 4552}" = <00007b43 00000000 0000f03f>; 
    "0x15d8ad10.posErrorMarker{id: 4526}" = <00007b43 00000000 0000f03f>; 
    "0x15d8b300:UIView-Encapsulated-Layout-Height.marker{id: 4567}" = <00803b44 00000000 0000f0bf>; 
    "0x15d8b3f0.posErrorMarker{id: 4541}" = <00007b43 00000000 0000f03f>; 
    "0x15d89a80.negError{id: 4563}" = <00803b44 00000000 0000f03f 00007b43 00000000 0000f03f>; 
    "0x15a3f5f0.marker{id: 4351}" = <00803b44 00000000 0000f0bf>; 
    "0x15d8baf0.negError{id: 4555}" = <00803b44 00000000 0000f03f>; 
    "0x15d8b880.negError{id: 4551}" = <00803b44 00000000 0000f03f>; 
    "0x15d86b60.posErrorMarker{id: 4546}" = <00007b43 00000000 0000f03f>; 
    "0x15d8ad50.negError{id: 4529}" = <00803b44 00000000 0000f03f>; 
    "0x15a3f4a0.marker{id: 4333}" = <00803b44 00000000 0000f03f>; 
    "0x1590d210.posErrorMarker{id: 4539}" = <00007b43 00000000 0000f03f>; 
    "0x15d8a900.posErrorMarker{id: 4516}" = <00007b43 00000000 0000f03f>; 
    "0x15d8b880.posErrorMarker{id: 4550}" = <00007b43 00000000 0000f03f>; 
    "0x15a3f590.marker{id: 4346}" = <00007b43 00000000 0000f03f>; 
    "0x15a43eb0.marker{id: 4324}" = <00803b44 00000000 0000f03f>; 
    "0x15a43ee0.marker{id: 4326}" = <00803b44 00000000 0000f03f>; 
    "0x15d8aea0.negError{id: 4535}" = <00803b44 00000000 0000f03f>; 
    "0x15d8b030.posErrorMarker{id: 4536}" = <00007b43 00000000 0000f03f>; 
    "0x15d8a900.negError{id: 4517}" = <00803b44 00000000 0000f03f>; 
    "0x15a3f560.marker{id: 4343}" = <00007b43 00000000 0000f03f>; 
    "0x15d89a00.negError{id: 4561}" = <00803b44 00000000 0000f03f 00007b43 00000000 0000f03f>; 
    "0x15d8a8b0.posErrorMarker{id: 4514}" = <00007b43 00000000 0000f03f>; 
    "0x15d8b840.posErrorMarker{id: 4548}" = <00007b43 00000000 0000f03f>; 
    "0x15d8b2d0:UIView-Encapsulated-Layout-Width.marker{id: 4564}" = <00803b44 00000000 000000c0>; 
    "0x15d8bc90.posErrorMarker{id: 4556}" = <00803b44 00000000 0000f03f 00007b43 00000000 0000f03f>; 
    "0x15d86b60.negError{id: 4547}" = <00803b44 00000000 0000f03f>; 
    "0x15a3f650.marker{id: 4355}" = <00007b43 00000000 0000f03f>; 
    "0x15d8a8b0.negError{id: 4515}" = <00803b44 00000000 0000f03f>; 
    "0x15d8b840.negError{id: 4549}" = <00403b44 00000000 0000f03f>; 
    "0x15d8b3f0.negError{id: 4542}" = <00803b44 00000000 0000f03f>; 
    "0x1590d210.negError{id: 4540}" = <00803b44 00000000 0000f03f>; 
    "0x15a43f10.marker{id: 4329}" = <00803b44 00000000 0000f03f>; 
    "0x15d8a980.negError{id: 4523}" = <00803b44 00000000 0000f03f 00007b43 00000000 0000f03f>; 
    "0x15d89f00.posErrorMarker{id: 4498}" = <00803b44 00000000 0000f03f 00007b43 00000000 0000f03f>; 
    "0x15a3f530.marker{id: 4340}" = <00007b43 00000000 0000f03f>; 
    "0x15d8ad50.posErrorMarker{id: 4528}" = <00007b43 00000000 0000f03f>; 
    "0x15d8ad10.negError{id: 4527}" = <00803b44 00000000 0000f03f>; 
    "0x15d8a3f0.posErrorMarker{id: 4506}" = <00803b44 00000000 0000f03f 00007b43 00000000 0000f03f>; 
    "0x15d8b030.negError{id: 4537}" = <00803b44 00000000 0000f03f>; 
    "0x15d8a440.negError{id: 4509}" = <00803b44 00000000 0000f03f 00007b43 00000000 0000f03f>; 
    "0x15d8b650.negError{id: 4545}" = <00803b44 00000000 0000f03f>; 
    "0x15a43f40.marker{id: 4332}" = <00803b44 00000000 0000f03f>; 
    "0x15d8b650.posErrorMarker{id: 4544}" = <00007b43 00000000 0000f03f>; 
    "0x15a43e50.marker{id: 4319}" = <00803b44 00000000 0000f03f>; 
    "0x15d8bab0.negError{id: 4553}" = <00803b44 00000000 0000f03f>; 
    "0x15a3f5c0.marker{id: 4349}" = <00803b44 00000000 0000f0bf>; 
    "0x15d8aea0.posErrorMarker{id: 4534}" = <00007b43 00000000 0000f03f>; 
    "0x15d89f40.posErrorMarker{id: 4500}" = <00803b44 00000000 0000f03f 00007b43 00000000 0000f03f>; 
} 

有沒有這方面的幫助?

+0

不是很有用的輸出。請在代碼出現的地方顯示。 – trojanfoe

+0

這些天我有類似的問題。我的問題與其中的removeObject有關。例如,如果您正在使用這種迭代並將其更改爲'for(int i = 0; i mxmlc

+0

該主題包含的重要信息指出,字典中元素的數量在枚舉重複循環中發生了變化(增加或減少)。 po dump是無意義的。 – vadian

回答

1

很可能你在迭代期間改變了你的收藏。爲避免崩潰,您可以複製密鑰並按照this post中所示進行迭代,或使用apple建議的方法。我認爲最簡單的方法是在迭代之前複製集合。

相關問題