Xcode 7 storyboard delegate datasource scenes

2019-02-12 03:26发布

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

6条回答
爷的心禁止访问
2楼-- · 2019-02-12 04:03

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

Identity Inspector - Document Label

This worked for me.

查看更多
\"骚年 ilove
3楼-- · 2019-02-12 04:07

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

查看更多
倾城 Initia
4楼-- · 2019-02-12 04:10

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楼-- · 2019-02-12 04:19

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>
查看更多
Root(大扎)
6楼-- · 2019-02-12 04:20

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

查看更多
一夜七次
7楼-- · 2019-02-12 04:22

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

查看更多
登录 后发表回答