GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(ios): keep ListView item views attached when UIKit removes their cell by NathanWalker · Pull Request #11637 · NativeScript/NativeScript

Conversation

@NathanWalker

@NathanWalker NathanWalker commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

PR Checklist

  • The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages.
  • There is an issue for the bug/feature this PR is for.
  • You have signed the CLA.
  • All existing tests are passing.
  • Tests for the changes are included.

What is the current behavior?

On iOS, ListViewCell.willMoveToSuperview(nil) calls ListView._removeContainer, which removes the cell's item view from the ListView. When UIKit reuses the cell, _prepareCell adds the view back and sets up its native views again.

UIKit takes cells out of the table on reloadData, which happens on every ObservableArray splice. In release builds the rebuild then fails in one of two ways:

  • Crash: NSInvalidArgumentException: -[DictionaryAdapter CGColor]: unrecognized selector (or _resolvedMaterialWithTraitCollection: on iOS 26). The data source then returns nil, and UIKit aborts in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:].
  • Frozen screen: the screen stops redrawing while the view tree keeps changing, and taps have no visible effect.

Repro (iOS 26.5 simulator, release build, @nativescript/core 9.1.3, @nativescript/ios 9.1.1):

  1. Use a ListView of two-column product rows bound to an ObservableArray.
  2. Sort controls clear the array and push a new page.
  3. Scroll, then switch sorts quickly.

Out of 6 runs of that flow:

  • with plain bound templates, the screen froze in 5;
  • with rows filled imperatively in itemLoading, the app crashed in all 6.

What is the new behavior?

ListViewCell no longer tears down its item view in willMoveToSuperview. Item views stay with their reusable cell and are disposed with the ListView: they remain in _map, so eachChildView covers them. The number of item views is still bounded by the number of cells UIKit creates. The _prepareCell path that swaps in a different view returned from itemLoading still calls _removeContainer.

Verification with the same app and flow, with core patched (via patch-package) and nothing else changed:

  • 10 of 10 stress runs passed with no crash or freeze.
  • An end-to-end flow passed across search paging, product, cart and tab switching.

ListViewHeaderCell.willMoveToSuperview uses the same pattern for sticky headers. This PR leaves it alone because I haven't reproduced a failure there.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@NathanWalker
fix(ios): keep ListView item views attached when UIKit removes their …
6747dd7
…cell

ListViewCell.willMoveToSuperview(nil) removed the item view from the
ListView, and _prepareCell rebuilt it when the cell was reused. UIKit
takes cells out of the table on reloadData (e.g. after an ObservableArray
splice), and in release builds that rebuild fails: an unrecognized
selector on DictionaryAdapter (CGColor / _resolvedMaterialWithTraitCollection:)
followed by UITableView's nil-cell assertion, or a screen that stops
redrawing. Item views now stay with their cell and are disposed with the
ListView.
@nx-cloud

nx-cloud Bot commented Nov 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 6747dd7

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 12s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-11-12 07:40:34 UTC

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pkg-pr-new

pkg-pr-new Bot commented Nov 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11637
npm i https://pkg.pr.new/@nativescript/vite@11637
npm i https://pkg.pr.new/@nativescript/webpack@11637

commit: 6747dd7

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Nov 12, 2026
NativeScript: fix the iOS ListView crash in core (patch-package) and drop the app's workarounds whiskerrs/benchmarks#2
Open
Fix API time for multi-result AI runs; add a second NativeScript run whiskerrs/benchmarks#3
Open

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@NathanWalker
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.