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:

enter image description here

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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -