Bug 27934 - A View Controller That Is Given a StoryboardID in the iOS Designer Cannot Be Found During Runtime.
Summary: A View Controller That Is Given a StoryboardID in the iOS Designer Cannot Be ...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.9
Hardware: PC Mac OS
: High major
Target Milestone: ---
Assignee: Bugzilla
URL:
: 28095 28148 28308 28393 28536 ()
Depends on:
Blocks:
 
Reported: 2015-03-11 20:29 UTC by Jimmy [MSFT]
Modified: 2015-04-09 04:59 UTC (History)
19 users (show)

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


Attachments
repro project (13.91 KB, application/zip)
2015-03-11 20:29 UTC, Jimmy [MSFT]
Details
Screen capture (1.91 MB, application/x-shockwave-flash)
2015-03-11 20:45 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details
IDE Logs (Mac) (74.21 KB, application/zip)
2015-03-11 20:51 UTC, Brendan Zagaeski (Xamarin Team, assistant)
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 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 Jimmy [MSFT] 2015-03-11 20:29:23 UTC
Created attachment 10282 [details]
repro project

=== Overview ===
A view controller that is given a StoryboardID through the iOS designer cannot be found and causes the app to crash. 

Looking at the Storyboard source code shows that the given ID is placed inside the “explicitStoryboardIdentifier” property, e.g.:

<tableViewController id="6" sceneMemberID="viewController" explicitStoryboardIdentifier="MyTableVC">

Previously, the ID property was called “storyboardIdentifier”. Manually editing the storyboard source code to change the property name fixes the issue, e.g.:

<tabBarController definesPresentationContext="YES" id="74" sceneMemberID="viewController" storyboardIdentifier="MyTabsVC">

However, when the property is changed to “storyboardIdentifier”, the ID does not appear inside the Properties window in the iOS designer. This also causes view controllers from previous projects to no longer display their ID inside the Properties window.

The issue is present in both Mac XS and VS iOS designer. I also tested the same project in Mac XS 5.7.2 could not reproduce the issue.

=== Steps to Reproduce ===
1. Run the attached repro project


=== Actual Results ===
The app crashes at line

 > this.Storyboard.InstantiateViewController ("MyTableVC");

because it cannot find a view controller with that ID. The previous line executes without issue because I modified that’s controller’s ID in the storyboard source.

If you load up the storyboard in the designer, the TableViewController’s ID is not visible in the Properties window because of the manual edit.


=== Expected Results ===
The app does not crash when looking for a view controller with a given ID and all view controllers’ ID can be seen in the Properties window.


=== System Info ===

=== Xamarin Studio ===

Version 5.8 (build 443)
Installation UUID: 94ce5106-6a72-4691-b34e-cd5857b1db66
Runtime:
	Mono 3.12.1 ((detached/b7764aa)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312010000

=== Xamarin.Android ===

Version: 4.20.0.37 (Business Edition)
Android SDK: /Users/jimmygarrido/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

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

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: 8.8.0.2 (Business Edition)
Hash: ccfcd59
Branch: 
Build date: 2015-03-10 02:20:32-0400

=== Xamarin.Mac ===

Version: 1.10.0.21 (Business Edition)

=== Build Information ===

Release ID: 508000443
Git revision: 73883239470cbe8e261c94d95f7c3d0452fd393b
Build date: 2015-03-10 07:22:51-04
Xamarin addins: a2ff7b617f09d9c45d8bbf3d010b5db0d7d36100

=== Operating System ===

Mac OS X 10.10.2
Darwin Jimmys-MacBook-Pro.local 14.1.0 Darwin Kernel Version 14.1.0
    Mon Dec 22 23:10:38 PST 2014
    root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2015-03-11 20:45:04 UTC
Created attachment 10283 [details]
Screen capture

Screen capture showing the appearance of:

> explicitStoryboardIdentifier="MyViewController"


Rather than the expected attribute of:

> storyboardIdentifier="MyViewController"


After adding a Storyboard ID to a View Controller in the designer.



Regression status: Regression between Xamarin Studio 5.7.2.7 (dcf3f486) and 5.8.0.443 (73883239).
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2015-03-11 20:51:11 UTC
Created attachment 10284 [details]
IDE Logs (Mac)

IDE logs corresponding to the screen capture in comment 2.

Complete version information corresponding to comment 2 also included the `VersionInformation.txt` file
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2015-03-11 20:52:37 UTC
CONFIRMED per comment 2 and comment 3.
Comment 5 Brendan Zagaeski (Xamarin Team, assistant) 2015-03-12 22:43:26 UTC
Just to add some additional searchable reference text to this report, here is the corresponding exception stack trace from running `this.Storyboard.InstantiateViewController("MyViewController")`:

> 2015-03-12 22:40:02.560 UniversalSingleView1[30288:796114] Unhandled managed exception: Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: Storyboard (<UIStoryboard: 0x7ad40d40>) doesn't contain a view controller with identifier 'MyViewController' (Foundation.MonoTouchException)
>   at ObjCRuntime.Runtime.ThrowNSException (IntPtr ns_exception) [0x00000] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Runtime.cs:156 
>   at ObjCRuntime.Runtime.throw_ns_exception (IntPtr exc) [0x00000] in /Developer/MonoTouch/Source/maccore/runtime/Delegates.generated.cs:100 
>   at (wrapper native-to-managed) ObjCRuntime.Runtime:throw_ns_exception (intptr)
>   at (wrapper managed-to-native) ObjCRuntime.Messaging:IntPtr_objc_msgSend_IntPtr (intptr,intptr,intptr)
>   at UIKit.UIStoryboard.InstantiateViewController (System.String identifier) [0x00028] in /Developer/MonoTouch/Source/monotouch/src/build/native/UIKit/UIStoryboard.g.cs:107 
>   at UniversalSingleView1.UniversalSingleView1ViewController.ViewDidLoad () [0x00012] in /private/tmp/Working/UniversalSingleView1/UniversalSingleView1/UniversalSingleView1ViewController.cs:34 
>   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 /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:62 
>   at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:46 
>   at UniversalSingleView1.Application.Main (System.String[] args) [0x00008] in /private/tmp/Working/UniversalSingleView1/UniversalSingleView1/Main.cs:17
Comment 6 Alan McGovern 2015-03-13 07:23:43 UTC
Fixed in master only with commit:

https://github.com/xamarin/md-addins/commit/69a693277b8eddf77216072e542f821964870f1b
Comment 7 Alan McGovern 2015-03-17 07:05:00 UTC
*** Bug 28095 has been marked as a duplicate of this bug. ***
Comment 8 Alan McGovern 2015-03-18 13:54:31 UTC
*** Bug 28148 has been marked as a duplicate of this bug. ***
Comment 9 Udham Singh 2015-03-18 15:15:31 UTC
I have checked this issue on following builds and observed that this issue has been fixed on mac but on windows we are still getting this issue.

Screencast (Mac) : http://www.screencast.com/t/Wi0amQELrv
Screencast (Windows) : http://www.screencast.com/t/HBdIh7DVjsG

Environment Info Mac (Master Builds): 

Mac OS X 10.9.5
Xamarin Studio  6.0 (build 173)
Mono 3.12.1 ((detached/b63df7d)
GTK+ 2.24.23 (Raleigh theme)
Xcode 6.2 (6776)
Xamarin.iOS 8.11.0.212 (Business Edition)

Environment Info Windows (Master Builds): 

Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.50938

Xamarin   5.0.175.0 (2afafa6)

As of now I am reopening this issue as I am still getting this issue on windows. Please let me know which build should I have to use to verify this issue.
Comment 10 Alan McGovern 2015-03-18 20:54:47 UTC
VS needs to bump to include a newer md-addins.
Comment 11 Moossa 2015-03-22 16:55:13 UTC
so I am having this problem, and editing the storyboard in text editor does not seem to fix it...When can we expect a xamarin studio update, as the latest available update is 5.8 and this seems to be fixed in 6.0..
Comment 12 Brendan Zagaeski (Xamarin Team, assistant) 2015-03-22 20:17:40 UTC
The fix has been released in the current alpha channel [1] version of Xamarin Studio: 5.8.2 (build 5), as well as the corresponding version of Xamarin for Visual Studio: 3.9.530.

> [1] http://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/
Comment 15 Alan McGovern 2015-03-24 12:49:40 UTC
*** Bug 28308 has been marked as a duplicate of this bug. ***
Comment 16 James 2015-03-24 20:30:11 UTC
*** Bug 28393 has been marked as a duplicate of this bug. ***
Comment 17 Alan McGovern 2015-03-30 12:03:02 UTC
*** Bug 28536 has been marked as a duplicate of this bug. ***
Comment 18 Alan McGovern 2015-04-09 04:59:46 UTC
*** Bug 28761 has been marked as a duplicate of this bug. ***