Post

Replies

Boosts

Views

Activity

Reply to App built with Xcode 16 crashes, worked fine with Xcode 15
And here is the section of the crash report. It says Thread 0 crashed, not Thread 1. Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libswiftCore.dylib 0x19481539c assertionFailure(::file:line:flags:) + 244 1 SulawesiFishIDApp2024.debug.dylib 0x10135078c DetailCollectionViewCell.tableView(:numberOfRowsInSection:) + 312 (DetailCollectionViewCell.swift:207) 2 SulawesiFishIDApp2024.debug.dylib 0x1013507cc @objc DetailCollectionViewCell.tableView(_:numberOfRowsInSection:) + 60 3 UIKitCore 0x185d38468 -[UITableView _numberOfRowsInSection:] + 48 4 UIKitCore 0x185d4c06c -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 1772 5 UIKitCore 0x185d50634 -[UITableViewRowData rectForFooterInSection:heightCanBeGuessed:] + 100 6 UIKitCore 0x185d50f0c -[UITableViewRowData heightForTable] + 48 7 UIKitCore 0x185cfb730 -[UITableView _updateContentSizeSkippingContentOffsetAdjustment:] + 164 8 UIKitCore 0x185d1fe78 -[UITableView _rebuildGeometryForcingRowDataUpdate:skipContentOffsetAdjustment:updateImmediatelyIfPossible:] + 136 9 UIKitCore 0x185d1e2a8 -[UITableView setLayoutMargins:] + 200 10 UIKitCore 0x185d1e1c4 -[UITableView _setDefaultLayoutMargins:] + 48 11 UIKitCore 0x185d1e134 -[UITableView didMoveToWindow] + 284 12 UIKitCore 0x18603ef14 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1868 13 UIKitCore 0x185fc5d1c -[UIScrollView _didMoveFromWindow:toWindow:] + 84 14 UIKitCore 0x18603ea8c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 708 15 UIKitCore 0x18603ea8c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 708 16 UIKitCore 0x186034720 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 124 17 UIKitCore 0x186034634 -[UIView _postMovedFromSuperview:] + 436 18 UIKitCore 0x186040ee8 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 2204 19 UIKitCore 0x1851d0bb8 -[UICollectionView _addSubview:positioned:relativeTo:] + 144 20 UIKitCore 0x185cccaa0 -[_UICollectionViewSubviewRouter addControlledSubview:zIndex:orderMode:] + 816 21 UIKitCore 0x1851d06f0 -[UICollectionView _addControlledSubview:atZIndex:forced:initialAttributes:] + 328 22 UIKitCore 0x1851d69c0 -[UICollectionView _applyLayoutAttributes:toView:addingControlledSubview:forced:] + 144 23 UIKitCore 0x1851eb70c __88-[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory:]block_invoke_2 + 108 24 UIKitCore 0x18603b5a0 +[UIView(Animation) performWithoutAnimation:] + 68 25 UIKitCore 0x1851eb388 -[UICollectionView dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory:] + 1332 26 UIKitCore 0x1851eb7e0 -[UICollectionView dequeueReusableCellWithReuseIdentifier:forIndexPath:] + 80 27 SulawesiFishIDApp2024.debug.dylib 0x101354b1c UICollectionView.dequeueReusableCell(for:) + 276 (UICollectionView+Extensions.swift:17) 28 SulawesiFishIDApp2024.debug.dylib 0x1013c4940 DetailViewController.collectionView(:cellForItemAt:) + 208 (DetailViewController.swift:327) 29 SulawesiFishIDApp2024.debug.dylib 0x1013c59c8 @objc DetailViewController.collectionView(:cellForItemAt:) + 136 30 UIKitCore 0x1851d521c __112-[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:]_block_invoke.357 + 48 31 UIKitCore 0x18603b5a0 +[UIView(Animation) performWithoutAnimation:] + 68 32 UIKitCore 0x1851d486c -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:] + 1192 33 UIKitCore 0x1851ddf10 -[UICollectionView _createVisibleViewsForSingleCategoryAttributes:limitCreation:fadeForBoundsChange:] + 520 34 UIKitCore 0x1851de478 -[UICollectionView _createVisibleViewsForAttributes:fadeForBoundsChange:notifyLayoutForVisibleCellsPass:] + 288 35 UIKitCore 0x1851dc618 -[UICollectionView _updateVisibleCellsNow:] + 3196 36 UIKitCore 0x1851e1744 -[UICollectionView layoutSubviews] + 284 37 UIKitCore 0x186044bd8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2404 38 QuartzCore 0x18b0bcfe4 CA::Layer::layout_if_needed(CA::Transaction*) + 432 39 QuartzCore 0x18b0c7d68 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 124 40 QuartzCore 0x18affca50 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 464 41 QuartzCore 0x18b02b260 CA::Transaction::commit() + 652 42 UIKitCore 0x185ad6c3c _UIApplicationFlushCATransaction + 80 43 UIKitCore 0x185a07ccc __setupUpdateSequence_block_invoke_2 + 352 44 UIKitCore 0x18505d28c _UIUpdateSequenceRun + 76 45 UIKitCore 0x185a07670 schedulerStepScheduledMainSection + 168 46 UIKitCore 0x185a06aa8 runloopSourceCallback + 80 47 CoreFoundation 0x18041b7c4 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24 48 CoreFoundation 0x18041b70c __CFRunLoopDoSource0 + 172 49 CoreFoundation 0x18041ae70 __CFRunLoopDoSources0 + 232 50 CoreFoundation 0x1804153b4 __CFRunLoopRun + 788 51 CoreFoundation 0x180414c24 CFRunLoopRunSpecific + 552 52 GraphicsServices 0x19020ab10 GSEventRunModal + 160 53 UIKitCore 0x185ad82fc -[UIApplication _run] + 796 54 UIKitCore 0x185adc4f4 UIApplicationMain + 124 55 SulawesiFishIDApp2024.debug.dylib 0x10137230c __debug_main_executable_dylib_entry_point + 64 (AppDelegate.swift:13) 56 dyld_sim 0x100c75410 start_sim + 20 57 dyld 0x1009b6274 start + 2840 Thread 1: 0 libsystem_pthread.dylib 0x100b5692c start_wqthread + 0 Thread 2: 0 libsystem_pthread.dylib 0x100b5692c start_wqthread + 0
Topic: UI Frameworks SubTopic: UIKit
Dec ’24
Reply to App built with Xcode 16 crashes, worked fine with Xcode 15
Claude, thank you for your quick and detailed reply. I don't know much about code, but here is what I think might be the relevant section. // // DetailCollectionViewCell.swift // SulawesiFishIDApp2024 // // Created by Geoff Hackworth on 06/01/2017. // Copyright © 2019 John Hoover. All rights reserved. // import UIKit protocol DetailCollectionViewCellDelegate: AnyObject { func detailCollectionViewCell(_ detailCollectionViewCell: DetailCollectionViewCell, didSelectImageAt index: Int) func detailCollectionViewCellDidSelectReefDistributionReport(_ detailCollectionViewCell: DetailCollectionViewCell) func detailCollectionViewCellDidSelectFishbase(_ detailCollectionViewCell: DetailCollectionViewCell) } final class DetailCollectionViewCell: UICollectionViewCell { weak var delegate: DetailCollectionViewCellDelegate? @IBOutlet fileprivate weak var tableView: UITableView! var tableViewContentInset: UIEdgeInsets = .zero { didSet { tableView.contentInset = tableViewContentInset } } struct ViewData { let commonName: String let isEndemic: Bool let isFamilyId: Bool let lengthDescription: String? let scientificName: String? let scientificFamily: String? let familyText: String? let rank: String? let reefReportGroupId: String? let fishbaseLinkId: String let upperImages: [UIImage] let lowerImages: [UIImage] let description: String }
Topic: UI Frameworks SubTopic: UIKit
Dec ’24