Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array representation: [nil] #24

Open
ahmadmssm opened this issue Apr 19, 2018 · 2 comments
Open

Array representation: [nil] #24

ahmadmssm opened this issue Apr 19, 2018 · 2 comments

Comments

@ahmadmssm
Copy link

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]

@MrAlek
Copy link
Owner

MrAlek commented Apr 19, 2018

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?

@ahmadmssm
Copy link
Author

ahmadmssm commented Apr 19, 2018

`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
}
}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants