0

星期五晚上,我的应用程序运行良好。所以星期六,我决定开始调整 UI。我添加了一个带有背景图像的图像视图,将其推到后面。然后移动一些控件以更好地排列。

现在,我的应用程序挂在模拟器的加载屏幕上,然后在我的 iPad 上进入黑屏。它根本没有错误。

我确实尝试删除背景图像,但没有效果。

我在 SPRAppDelegate.m 上的 didFinishLaunchingWithOptions 中设置了断点,它毫无问题地通过该函数。与 SPRViewController.m 上的 ViewDidLoad 相同

我有一些子类文本字段,所以我在子类文件的 awakeFromNib 函数之一中设置了一个断点。那不会被执行。

我不确定哪些源代码会有所帮助,但这是我的 info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIcons</key>
<dict>
    <key>CFBundlePrimaryIcon</key>
    <dict>
        <key>CFBundleIconFiles</key>
        <array>
            <string>ring-it-up-sm-reversed.png</string>
            <string>ring-it-up-72-reversed.png</string>
        </array>
    </dict>
</dict>
<key>CFBundleIdentifier</key>
<string>com.steveradabaugh.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
    <string>armv7</string>
</array>
<key>UIStatusBarHidden~ipad</key>
<false/>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</dict>
</plist>

我注意到它根本没有列出主笔尖,但我认为您不再需要这样做。

这是 Main.m #import

#import "SPRAppDelegate.h"

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([SPRAppDelegate class]));
    }
}

来自 SPRAppDelegate.m:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.viewController = [[SPRViewController alloc] initWithNibName:@"SPRViewController" bundle:nil];
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    return YES;
}

我还能提供什么帮助?

[编辑] 我一直在玩弄想弄明白。它显示我的加载/启动屏幕,然后显示背景图像,但不加载任何控件。(在模拟器中)。在设备上,它显示启动画面,然后是黑色。我更改了加载屏幕,以便它们与背景不同。

4

0 回答 0