This is a migrated thread and some comments may be shown as answers.

iOS UICollectionView logs "invalid update"

5 Answers 554 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Evan
Top achievements
Rank 1
Evan asked on 14 Aug 2020, 09:26 PM

On iOS, when the collection items change, the changes are not being rendered properly.

I am using sort and group delegate descriptors and the items determine the order and group they are placed in. However, when updating the items, the changes are not visually applied or the rendered items end up in an invalid state. There are logs emitted, like the one below.

[UICollectionView] Invalid update: invalid number of items in section 0.  The number of items contained in an existing section after the update (3) must be equal to the number of items contained in that section before the update (3), plus or minus the number of items inserted or deleted from that section (1 inserted, 0 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out). - will perform reloadData. UICollectionView instance: <TKCollectionView: 0x7faf86b41c00; baseClass = UICollectionView; frame = (0 0; 414 774); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x600001f4e610>; layer = <CALayer: 0x6000058ae760>; contentOffset: {0, 0}; contentSize: {414, 334}; adjustedContentInset: {0, 0, 0, 0}; layout: <TKListViewLinearLayout: 0x7faf83090250>; dataSource: <Telerik_XamarinForms_DataControlsRenderer_iOS_TKExtendedListView: 0x7faf8308ee50; frame = (0 0; 414 774); layer = <CALayer: 0x
6000058ae5e0>>>; currentUpdate: [UICollectionViewUpdate - 0x7faf83098630: old:<UICollectionViewData: 0x600002858620> new<UICollectionViewData: 0x600002858b60> items:<(
    "I(0,2)"
)>]

5 Answers, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 17 Aug 2020, 08:54 AM

Hello Evan,

We have reproduced similar exception in our Telerik Xamarin Sample app when applying changes in the listview itemssource, for example: update/clear/add items/remove items to the collection. 

The issue was fixed and a fix for it is included in the Telerik UI for Xamarin version 2020.1.318. here are the release notes: https://www.telerik.com/support/whats-new/xamarin-ui/release-history/ui-for-xamarin-r1-2020-(version-2020-1-318-410)

ListView
FIXED
[iOS] An exception is thrown when clearing the ItemsSource and then adding items.

could you please elaborate more on which version of Telerik UI for Xamarin is used in the project where the issue can be reproduced? Also of a great help will be, if you can send us a sample project where the exception occurs. Note that you will need to open a support ticket and attach the project there as in the forum only image attachments are allowed. 

I look forward to your reply.

Regards,
Didi
Progress Telerik

0
Evan
Top achievements
Rank 1
answered on 17 Aug 2020, 01:47 PM

Hi Didi,

I am using version 2020.2.624.1. I will open a ticket with a reproduction sample and also link the sample here.

0
Didi
Telerik team
answered on 17 Aug 2020, 02:33 PM

Hi Evan,

Thank you for your information. Please take your time and when the project is ready attach it to the support ticket's thread. Also, in the support ticket please send us the information on which ios device/simulator version the issue can be reproduced?

Thank you in advance.

Regards,
Didi
Progress Telerik

0
Evan
Top achievements
Rank 1
answered on 17 Aug 2020, 06:13 PM

Hi Didi,

I just submitted a ticket. The sample project is here: https://github.com/EvanMulawski/TelerikXamarinListViewIssue

0
Didi
Telerik team
answered on 20 Aug 2020, 11:14 AM

Hello Evan,

Thank you for the provided project. I have sent a reply to the support ticket thread.

Regards,
Didi
Progress Telerik

Tags
ListView
Asked by
Evan
Top achievements
Rank 1
Answers by
Didi
Telerik team
Evan
Top achievements
Rank 1
Share this question
or