大橙子网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

yourSecondiOSApp(5)—Troubleshooting-创新互联

Next

向阳网站建设公司创新互联公司,向阳网站设计制作,有大型网站制作公司丰富经验。已为向阳上千多家提供企业网站建设服务。企业网站搭建\成都外贸网站制作要多少钱,请找那个售后服务好的向阳做网站的公司定做!

Previous

Troubleshooting

故障排除

If you have trouble getting the BirdWatching app to work correctly, try the problem-solving approaches described in this chapter.

如果BirdWatching app运行的时候有问题,尝试本章中描述的解决问题的办法。

Code and Compiler Warnings

代码和编译器警告

If the app isn’t working as it should, first compare your code with the code in “Code Listings.”

如果app没有如它应该的那样运行,首先将你的代码和代码清单中的代码进行比较。

The tutorial code should compile without any warnings. If Xcode reports a warning, it’s a good idea to treat the warning in the same way that you treat errors. Objective-C is a very flexible language, and sometimes a warning is the only indication you receive when there is an issue that might cause an error.

本教程的代码应该没有任何编译器警告。如果Xcode报告警告,与处理错误一样的方式来处理这些警告是一个好主意。Objective-C是非常灵活的语言,有时候一个警告仅仅是一个迹象,告诉你那儿有问题它可能会导致错误。

Storyboard Items and Connections

故事板项和连接

When you’re accustomed to fixing all of an app’s problems in code, it’s easy to forget to check the objects in the storyboard. A great advantage of a storyboard is that, because it captures both the appearance and some of the configuration of app objects, you have less coding to do. To benefit from this advantage, it’s important to examine the storyboard, as well as the code, when an app doesn’t behave as you expect. Here are some examples.

当你已经习惯了修复代码中的所有的app问题时,人们很容易忘记在故事板中检查对象。故事板的一个很大的优势是,因为它同时获取对象的外观以及对象的一些配置,你仅需要很少的代码。受益于这种优势,检查故事板显得非常重要,就像检查代码一样,当app不能如你希望般起作用。这儿有一些例子。

A scene does not seem to receive the data you send to it in the prepareForSegue method. Check the segue’s identifier in the Attributes inspector. If you forget to give the segue the same identifier that you use in the prepareForSegue method, you can still transition to the scene during testing, but the scene won’t display the data that you send to it.

一个场景似乎没有接收到你通过prepareForSegue方法发送给它的数据。在属性检查器中检查segue的标识符。如果你忘了给segue和你在prpareForSegue方法里面使用的相同的标识符,你在测试的时候仍然能转换到场景,但是场景不能显示你发送的数据。

The same result occurs when you misspell a segue’s identifier in the prepareForSegue method. Xcode does not warn you when a segue is missing its identifier, or when the prepareForSegue method uses an incorrect identifier, so it’s important to check these values for yourself.

相同的结果也放生在当你在prepareForSegue方法里拼写了错误的segue标识符。当segue缺失标识符的时候,或者当prepareforSegue方法使用不正确的标识符的时候,Xcode不会有警告,所以,自己检查这些值非常重要。

None of your changes to a custom view controller class seem to affect its scene. Check the scene’s class in the Identity inspector. If the name of your custom view controller class is not displayed in the Class pop-up menu, Xcode does not apply your changes to the scene.

自定义视图控制器类中做出的改变似乎没有影响到到场景。在身份检查器中检查场景的类。如果你的自定义视图控制器类的名师没有显示在Class弹出菜单里面,Xcode没有应用你的改变到这个场景。

Nothing happens when you click the Cancel or Done buttons in the add scene’s navigation bar. Make sure each button is connected to its unwind action. Control-click the button on the canvas or in the document outline and confirm that the connection in the Triggered Segues section is active and correct.

当你点击add 场景的导航条上的Done或者Cancel按钮的时候没有任何动作。确保每个按钮已经联系到它的unwind action。在画布中或贼文档大纲中按住Control并点击这个按钮,并在Triggered Segues部分去人连接是被正确触发的。

the text fields appear to work, but the data you enter is not displayed in the master list. Make sure the view controller’s outlets are connected to the text fields.

文本字段使工作的,但你输入的数据没有显示在主列表。确保视图控制器的outlets已经连接到文本字段。

Delegate Method Names

委托方法名字

A common mistake related to using delegates is to misspell the delegate method name. Even if you’ve set the delegate object correctly, if the delegate doesn’t use the right name in its method implementation, the correct method won’t be invoked. It’s usually best to copy and paste delegate method declarations—such as textFieldShouldReturn:—from a reliable source (such as the documentation or the declaration in a header file).

使用代理的常见错误是拼错委托方法的名字。即使你正确的设置了代理对象,如果在代理没有在方法实现中使用正确的名字,正确的方法将不被调用。通常最好的方法是从可靠的来源(例如文档或者头文件里的声明)复制粘贴代理方法声明——例如textFieldShouldReturn:。

Next

Previous

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


新闻标题:yourSecondiOSApp(5)—Troubleshooting-创新互联
分享链接:http://dzwzjz.com/article/dseidc.html
在线咨询
服务热线
服务热线:028-86922220
TOP