MrAlek/PagedArray

Array representation: [nil]

Opened this issue · 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]

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?

`self.pagedArray = PagedArray(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
}
}
`