07 2012 档案

摘要:1 2012-07-31 00:52:35.709 apress-16-3[2345:f803] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x6a71920> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key latitudeLabel.'.xib 中的 Labe 控件链接到 .h 阅读全文
posted @ 2012-07-31 00:59 SubmarineX 阅读(4573) 评论(1) 推荐(0)
摘要:.摘自:《Beginning.iOS.5.Development.Exploring.the.iOS.SDK》1 #pragma mark -2 #pragma mark Picker Data Source Methods3 Any line of code that begins with #pragma is technically a compiler directive. More specifically, a #pragma marks a pragmatic, or compiler-specific, directive that won’t necessarily work 阅读全文
posted @ 2012-07-29 13:17 SubmarineX 阅读(456) 评论(0) 推荐(0)
摘要:In Xcode 4.3.2,Right click the Project Name in the Project Navigator, and choose "Show in Finder";In Finder, right click the setting.bundle and choose "Show Package Contents";Copy the new .plist to setting.bundle;Back to XCode, open the "setting.bundle", wilfully add on 阅读全文
posted @ 2012-07-25 11:00 SubmarineX 阅读(1598) 评论(0) 推荐(0)
摘要:建立Empty Application,新建Storyboard并添加View Controller 控件后运行为空白,并报错控制台显示:2012-07-18 15:21:57.338 apress-8[664:f803] Application windows are expected to have a root view controller at the end of application launch通过和Single View Application模版对比发现:需要至少修改两个地方:1、AppDelegate.m 1 - (BOOL)application:(UIApplica 阅读全文
posted @ 2012-07-18 15:28 SubmarineX 阅读(2351) 评论(0) 推荐(0)
摘要:用Storyboard做的。做点记录总的效果:总的结构:视图结构:新建一个Tabbed ApplicationPS:我直接建Single View Application,然后删除里面的ViewController类文件和Storyboard中默认的控制器视图,自己添加Tab Bar Controller 控件新建一个UITabBarController类的文件(.h,.m);PS:在本次学习内容中,对UITabBarController类文件没有修改。Tab Bar Controller控件关联到UITabBarController实例。分别添加标签栏中标签所对应的控制器控件(本次用到5个V 阅读全文
posted @ 2012-07-18 00:27 SubmarineX 阅读(609) 评论(0) 推荐(0)
摘要:。在区间内,先单调递增再单调递减(或先单调递减再单调递增)。 1 double Trisection(double dLeft, double dRight, ...) 2 { 3 double dMid = dLeft, dMidMid = dRight; 4 5 while (dMidMid - dMid > 1e-6) 6 { 7 dMid = (dLeft + dRight) / 2; 8 dMidMid = (dMid + dRight) / 2; 9 if (Calc(dMid, ...) > Calc(dM... 阅读全文
posted @ 2012-07-17 22:50 SubmarineX 阅读(334) 评论(0) 推荐(0)
摘要:SwitchViewController 负责在按下Switch Views 时切换 BlueViewController 和 YellowViewController。控制器类 和 对应的 .xib文件 都是单独创建。手动组建效果图:1、新建 Empty Application 。不选 “Use Core Data”2、新建 SwitchViewController 类和 SwitchViewController.xib BlueViewController 类和BlueView.xib YellowViewController 类和 YellowView.xib3、编写Swit... 阅读全文
posted @ 2012-07-15 23:26 SubmarineX 阅读(537) 评论(0) 推荐(0)
摘要:Portrait:主视图为竖放;Landscape:主视图为横放。Interface Builder,以下简称IB(我习惯用StoryBoard来做的,一下简称SB)。设置视图横放(在IB中),选择要横放的视图,在右边的Orientation中选择Landscape:做“切换视图”这个内容,在SB中没思绪,先找着书在IB中做了一遍,在回到SB中做了一遍。在SB中:需要在View Control中分别移进移出两个View来做控件布局,感觉略麻烦。效果图:对与属性设置strong或weak还有点疑惑?两个视图的属性射程weak,则运行后是黑屏: 阅读全文
posted @ 2012-07-14 22:08 SubmarineX 阅读(205) 评论(0) 推荐(0)
摘要:1、完成输入后关闭键盘:选中Text Field控件,设置Return Key为Done:为控件添加事件:点击Done隐藏键盘:2、通过触摸背景关闭键盘:更改View指向的对象类,原先为UIView,通过右边改成UIControl,注意左边红框中原先名为View:选中当前的名为Control的图标:为它添加事件,注意箭头指出的是与方法建立联系的UIContril对象:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~点击背景即可隐藏键盘 阅读全文
posted @ 2012-07-14 21:52 SubmarineX 阅读(384) 评论(0) 推荐(0)