簡體   English   中英

線程 1:EXC_ARITHMETIC(code=EXC_I386_DIV,subcode=0x0) 在 Objective c 中?

[英]Thread 1:EXC_ARITHMETIC(code=EXC_I386_DIV,subcode=0x0) in Objective c?

我是 iOS 編程的新手。 當我運行我的項目時,我收到線程錯誤,例如:

線程 1:EXC_ARITHMETIC(code=EXC_I386_DIV,subcode=0x0)

我不知道如何解決該線程錯誤。 任何人都可以為這個問題提出解決方案嗎?

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    NSUInteger residue =  ([uiGridViewDelegate numberOfCellsOfGridView:self] % [uiGridViewDelegate numberOfColumnsOfGridView:self]);

    if (residue > 0) residue = 1;

    return ([uiGridViewDelegate numberOfCellsOfGridView:self] / [uiGridViewDelegate numberOfColumnsOfGridView:self]) + residue;
}

我附上了圖片

我在 c++ 函數中運行模運算時遇到了同樣的問題。 經過一番研究,我發現分裂存在問題。 我開始調試,是的,我除以零...所以如果有人也有這個問題,請開始調試並檢查你是否除以零。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM