Xcode 4.2 iOS Empty Application and storyboards(Xcode 4.2 iOS 空应用程序和故事板)
问题描述
我是 Xcode 新手,我正在尝试制作我的第一个培训应用程序.因为显然空应用程序模板是唯一提供预集成核心数据的模板,所以我选择了它.但是,在那之后,我无法让 UI 工作(它仍然是空的).
I'm an Xcode newbie, and I'm trying to make my first training app. Since apparently Empty Application template is the only template that offers pre-integrated Core Data, I choose that. However, after that, I can't get UI to work (it remains empty).
我做了什么:
- 空应用程序模板
- 新的 iPad 故事板文件
- 将标签栏控制器溅到上面
- 更改了项目摘要视图中的主要故事板
- 点击⌘R
- 盯着纯白色的 iPad 屏幕,没有任何标签
我尝试对比我创建为标签栏应用程序的另一个项目(它确实反映了我的情节提要更改),但没有任何见解.
I tried diffing against another project that I created as a Tab Bar Application (which does reflect my Storyboard changes), without any insight.
推荐答案
注释掉(或删除)AppDelegate.m中的窗口创建和显示代码如下:
Comment out (or remove) the window creation and display code in AppDelegate.m as follows:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
// self.window.backgroundColor = [UIColor whiteColor];
// [self.window makeKeyAndVisible];
return YES;
}
使用情节提要时,会自动为您创建一个主 UIWindow.您的情况是,您正在创建另一个白色窗口并将其放在选项卡 UI 的顶部.
When using a storyboard, a main UIWindow is created for you automatically. What is happening in your case is that you are creating another white window and putting it over the top of the tab UI.
ALSO - 请注意,主/明细模板还为您提供了核心数据选项.
ALSO - note that the Master/Detail template also gives you a core data option.
这篇关于Xcode 4.2 iOS 空应用程序和故事板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Xcode 4.2 iOS 空应用程序和故事板


- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01