Bug 30420 - DequeueReusableCell(cellIdentifier) returns null
Summary: DequeueReusableCell(cellIdentifier) returns null
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll (show other bugs)
Version: XI 8.10
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-05-26 00:28 UTC by developers
Modified: 2015-06-30 09:18 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Sample Project (14.75 KB, application/zip)
2015-05-26 00:28 UTC, developers
Details
App in 8.9.x (22.98 KB, image/png)
2015-05-26 00:29 UTC, developers
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description developers 2015-05-26 00:28:16 UTC
Created attachment 11319 [details]
Sample Project

Since updated to 8.10.x (stable) our application (which has been built weekly with the latest Xamarin Studio / iOS 8.X) is unable to handle some UITableViews. The issue we have encountered is 2 of 8 tables (and collections) return null when we call "DequeueReusableCell(cellIdentifier)" in the TableViewSource.

As requested by Brendan Zagaeski ( https://forums.xamarin.com/discussion/37278/stable-release-xamarin-ios-8-10-0-new-features-and-bug-fixes/p3 ), we have included a sample project. This project builds against 8.9.x but returns null cells for 8.10.x (stable).

No error is thrown for the "dequeue" command, but the null cell throws an error stating that it must return a cell.

 Foundation.MonoTouchException: Objective-C exception thrown.  Name: NSInternalInconsistencyException Reason: UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:
  at ObjCRuntime.Runtime.ThrowNSException (IntPtr ns_exception) [0x00000] in /Users/builder/data/lanes/1799/3c4e832a/source/maccore/src/ObjCRuntime/Runtime.cs:167
  at ObjCRuntime.Runtime.throw_ns_exception (IntPtr exc) [0x00000] in /Users/builder/data/lanes/1799/3c4e832a/source/maccore/runtime/Delegates.generated.cs:100
  at at (wrapper native-to-managed) ObjCRuntime.Runtime:throw_ns_exception (intptr)
  at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/1799/3c4e832a/source/maccore/src/UIKit/UIApplication.cs:63
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/1799/3c4e832a/source/maccore/src/UIKit/UIApplication.cs:47
  at TestUITableViewCell.Application.Main (System.String[] args) [0x00008] in /Users/ve4d/Projects/TestUITableViewCell/Main.cs:12


Xamarin About:
=== Xamarin Studio ===

Version 5.9.1 (build 3)
Installation UUID: ba66f7fc-1ebf-4a75-b078-cf060315682b
Runtime:
	Mono 4.0.0 ((detached/d136b79)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400000143

=== Xamarin.Android ===

Version: 5.1.1.0 (Business Edition)
Android SDK: /Users/username/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 6.3.2 (7718)
Build 6D2105

=== Xamarin.iOS ===

Version: 8.10.0.303 (Business Edition)
Hash: 3c4e832
Branch: master
Build date: 2015-05-20 21:47:57-0400

=== Xamarin.Mac ===

Version: 2.0.0.262 (Starter Edition)

=== Build Information ===

Release ID: 509010003
Git revision: aad75a6e7e48f18120ce41f47d0ff2c6216f49c3
Build date: 2015-05-08 12:46:18-04
Xamarin addins: 1246b3044cbb7f56a217334f8fc5489ef8eefe3f

=== Operating System ===

Mac OS X 10.10.3
Darwin mac.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 1 developers 2015-05-26 00:29:11 UTC
Created attachment 11320 [details]
App in 8.9.x
Comment 2 Rolf Bjarne Kvinge [MSFT] 2015-05-26 05:46:03 UTC
Fixed.

maccore/master: 8d3cb3362618f34aa2c1fabd227cd0fd59fa4fff

The problem is that we end up executing the 'tableview' constructor earlier in 8.10, and since you call 'this.TableView' in the constructor, that property is also instantiated earlier.

The workaround is to not do anything in the 'tableview' constructor, do it all in ViewDidLoad or ViewWillAppear.
Comment 4 Mohit Kheterpal 2015-06-19 10:14:00 UTC
I have checked this issue with attached sample in bug description and observed that this sample deploy and launch successfully with X.iOS 8.10.1.74.

Hence closing this issue by marking it as VERIFIED.
Comment 5 GouriKumari 2015-06-19 12:49:14 UTC
Verified with Xamarin.iOS Version 8.10.2.74 and the app launched on both iOS9 and iOS8 devices without any crash.

Logs:
Application Output: https://gist.github.com/GouriKumari/b3c4c6b77748835e7bcb
Build Log: https://gist.github.com/GouriKumari/4cbd92934fc309bb6a34

Supplemental Info:
I could reproduce the issue with Xamarin.iOS 8.10.2.71.pkg


Test Env:

=== Xamarin Studio ===

Version 5.9.3 (build 1)
Installation UUID: 5ed3a124-4b77-4c6f-beb9-c830fd815e2a
Runtime:
	Mono 4.0.1 ((detached/ed1d3ec)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400010044

=== Xamarin.Android ===

Version: 5.1.3.1 (Enterprise Edition)
Android SDK: /Users/gourikumari/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
Java SDK: /usr
No Java runtime present, requesting install.

=== Xamarin Android Player ===

Not Installed

=== Apple Developer Tools ===

Xcode 6.3.2 (7718)
Build 6D2105

=== Xamarin.iOS ===

Version: 8.10.1.74 (Enterprise Edition)
Hash: 6916d0e
Branch: master
Build date: 2015-06-18 17:18:10-0400

=== Xamarin.Mac ===

Version: 2.0.1.64 (Enterprise Edition)

=== Build Information ===

Release ID: 509030001
Git revision: 5a524e1726ed103fdd4fe37e0356f2b35466ce9d
Build date: 2015-06-02 16:35:08-04
Xamarin addins: 51957cfbd06be911b212671ad05c2c6221ac90f9

=== Operating System ===

Mac OS X 10.10.3
Darwin Gouri-iMac.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64