Xcode 7 storyboard delegate datasource scenes

2019-02-12 04:11发布

问题:

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

Changing the title doesn't help

回答1:

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

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

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

Step 3 Rename it to something meaningful.

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



回答2:

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'.



回答3:

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>


回答4:

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



回答5:

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

This worked for me.



回答6:

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