objective c - Exc bad access in table view - iOS -
i have array fill when user click search button. if there no data response, server return empty response , therefore here empty array. wonder, why when fire fake request return me exc_bad_access (code=1, address = 0xa)
.
it point to:
- (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { if (_arrvalues.count > 0) return self.arrvalues.count; return 0; }
to line:
if (_arrvalues.count > 0)
in viewdidload
did allocate array that:
_arrvalues = @[];
so, cant understand why occurs. suggestions?
in debugger prints array memory , isa pointer, there no data if user search fake request return nothing.
from debug panel:
when update server part (remove response , create empty array) problem disappeared. there issue in request/mapping part:
// _arrvalues = [eventsmgr geteventsfromresponse:x]; _arrvalues = @[];
use code
- (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { return [_arrvalues count]; }
Comments
Post a Comment