Xcode storyboard delegate datasource scenes
Asked Answered
F

6

15

After updating Xcode 7, some of my viewcontrollers' names changed to Delegate Scene, what to do about this? Thanks! enter image description here

Changing the title doesn't help enter image description here

Fluky answered 17/9, 2015 at 5:11 Comment(6)
Given the fact that no one did reply I assume that this is a rather uncommon problem - if not unique. Is there any chance you could provide the storyboard for examination?Intertwine
@HelgeBecker Well it seems like at least 5 people have this problem within a few weeks, so there might be something to it. I am afraid I am not allowed to share our storyboard.Icbm
@ Ted: Roger, it is not an isolated issue. Sorry to hear. Where you able to reproduce the issue in a new project that doesn't contain critical data?Intertwine
I presume you've tried renaming it.Aerosol
@SteveWilford No - because I do not know which property to use, that is not shown in the app UI?Icbm
Same here, looks like Xcode 7 regression.Petepetechia
A
15

Try renaming the controller to whatever you want it to be:

Step 1 Select the "controller", named "Delegate" in your screenshot.

enter image description here

Step 2 Click again on "Delegate", or press [Enter] to enter renaming mode.

enter image description here

Step 3 Rename it to something meaningful.

enter image description here

Step 4 Deselect or press [Enter] again to save the changes. The scene name will be updated to match the name you specified.

enter image description here

Aerosol answered 8/10, 2015 at 7:6 Comment(3)
Thanks - I don't know why I haven't thought about that. But I would still like to figure out what the problem is in the storyboard file provided.Icbm
It does not always work - the name is changed back just after renaming it!Icbm
The rename maps to Document: Label in Identity Inspector - rename it there, it will always work.Icbm
F
5

Select View Controller -> Identity Inspector -> Document Label and rename it here.

Identity Inspector - Document Label

This worked for me.

Faena answered 16/7, 2018 at 10:7 Comment(0)
C
3

Adding to @Steve Wilford Reply:

In Xcode 7's story board, there is limitation on length of name of view controller to be shown in left pane which is 15 characters. All the names having greater than 15 characters, will be changed to strange name say 'Delegate Scene' or 'Data Source Scene'.

Corabella answered 3/11, 2015 at 6:58 Comment(0)
I
2

I dont have a direct answer, but a place to look. Unfortunately it exceed the space for comment, so I have to put it here. Sorry.

If you select the storyboard in the project explorer, you can open its sourcecode. Storyboards are just XML files. How does the viewcontroller look like? Compare it to a reference,eg a freshly created one. Perhaps you can share the xml part of the viewcontroller? Example with one (out of the box) view controller:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
    <dependencies>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
    </dependencies>
    <scenes>
        <!--View Controller-->
        <scene sceneID="tne-QT-ifu">
            <objects>
                <viewController id="BYZ-38-t0r" customClass="ViewController" customModule="eee" customModuleProvider="target" sceneMemberID="viewController">
                    <layoutGuides>
                        <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
                        <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
                    </layoutGuides>
                    <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
                        <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                        <animations/>
                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
                    </view>
                </viewController>
                <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
            </objects>
        </scene>
    </scenes>
</document>
Intertwine answered 5/10, 2015 at 14:10 Comment(0)
R
2

Check the title property of your View Controller, the name of the view controller comes from either the title property or the Class.(Title taking precedence)

Screenshot

Also you can rename the controller manually if you want as suggested by Steve

Riha answered 9/10, 2015 at 6:36 Comment(0)
B
1

Here is a project where you can clearly see that this is a Interface Builder bug. I have reported it but no responce. Id is 22972580.

DelegateBug.zip

Bournemouth answered 13/11, 2015 at 22:42 Comment(2)
The bug still exists. I implemented a carousel. When I set the data source and delegate of my UIVIew to the view controller ('yellow circle'), it changed name of scene to 'Data Source'. Have tried to rename scene, title, storyboard ID, etc... nothing helps. I even tried to change it at source code of the story board.Evangelinaevangeline
Actually, @Corabella has it correct in his answer below. While I had a long scene name originally (that displayed fine as the scene name), adding my UIVIew's delegate and data sources to the ViewController changed the name to Data Source for every relevant scene. But, shortening the name now seems to do the trick.Evangelinaevangeline

© 2022 - 2024 — McMap. All rights reserved.