PagedArray icon indicating copy to clipboard operation
PagedArray copied to clipboard

Array representation: [nil]

Open ahmadmssm opened this issue 7 years ago • 2 comments

i can print the pagedArray object content but when i do something like this pagedArray[0], the result is always nil and after debugging i get this : Array representation: [nil]

ahmadmssm avatar Apr 19 '18 09:04 ahmadmssm

Hi! That sounds weird. I cannot reproduce this issue and there are several unit test which tests this case and passes. Can you show in a few lines of code how you can reproduce this?

MrAlek avatar Apr 19 '18 09:04 MrAlek

`self.pagedArray = PagedArray<SPass>(count: (object as! Page).total!, pageSize: ((object as! Page).records_per_page)!) // Set page items self.pagedArray?.set(((object as! Page).records)!, forPage: self.pageNumber)

// Use array items self.pagedArray?[0] -> nil although when i print the pagedArray object i can see items at index 0 // i just made those changed because the count is not true but still the same resultpublic var updatesCountWhenSettingPages: Bool = true //
else { // High Chaparall mode, array can change in size count += elements.count-expectedSize if page > lastPage { count += (page-lastPage)*pageSize } } `

ahmadmssm avatar Apr 19 '18 09:04 ahmadmssm