<Error>: CGContextDrawImage: invalid context 0x0o類似此種報錯

今天一個cocos2d-x的遊戲項目,在模擬器上沒有問題,在真機上調試的時候會刷出一串這種錯誤,差不多如下:

<Error>: CGContextSaveGState: invalid context 0x0
<Error>: CGContextDrawLinearGradient: invalid context 0x0
<Error>: CGContextSetFillColorWithColor: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextSetFillColorWithColor: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextSaveGState: invalid context 0x0
<Error>: CGContextDrawLinearGradient: invalid context 0x0
<Error>: CGContextSetFillColorWithColor: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextSetFillColorWithColor: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
於是找啊找原因,後來在stackOverFlow上看到一個自我安慰的說法,說到這是ios6的一個bug,常出現在和輸入輸出,界面繪製相關的地方,並且表示該錯誤不會影響應用的運行,我不知道是否準確,但是我的遊戲項目中,確實是在加載默認畫面,加載引擎之前,初始化的時候出現的,所以感覺和代碼相關不是很大,而且確實沒有影響到遊戲的運行,所以估且就這樣吧,這裏記錄一下,提醒自己,別下回又忘了摳原因摳一晚上~

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章