yourSecondiOSApp(5)—Troubleshooting-創(chuàng)新互聯(lián)

Next

向陽網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián)公司,向陽網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為向陽上千多家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站制作要多少錢,請找那個(gè)售后服務(wù)好的向陽做網(wǎng)站的公司定做!

Previous

Troubleshooting

故障排除

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

如果BirdWatching app運(yùn)行的時(shí)候有問題,嘗試本章中描述的解決問題的辦法。

Code and Compiler Warnings

代碼和編譯器警告

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

如果app沒有如它應(yīng)該的那樣運(yùn)行,首先將你的代碼和代碼清單中的代碼進(jìn)行比較。

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.

本教程的代碼應(yīng)該沒有任何編譯器警告。如果Xcode報(bào)告警告,與處理錯(cuò)誤一樣的方式來處理這些警告是一個(gè)好主意。Objective-C是非常靈活的語言,有時(shí)候一個(gè)警告僅僅是一個(gè)跡象,告訴你那兒有問題它可能會導(dǎo)致錯(cuò)誤。

Storyboard Items and Connections

故事板項(xiàng)和連接

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.

當(dāng)你已經(jīng)習(xí)慣了修復(fù)代碼中的所有的app問題時(shí),人們很容易忘記在故事板中檢查對象。故事板的一個(gè)很大的優(yōu)勢是,因?yàn)樗瑫r(shí)獲取對象的外觀以及對象的一些配置,你僅需要很少的代碼。受益于這種優(yōu)勢,檢查故事板顯得非常重要,就像檢查代碼一樣,當(dāng)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.

一個(gè)場景似乎沒有接收到你通過prepareForSegue方法發(fā)送給它的數(shù)據(jù)。在屬性檢查器中檢查segue的標(biāo)識符。如果你忘了給segue和你在prpareForSegue方法里面使用的相同的標(biāo)識符,你在測試的時(shí)候仍然能轉(zhuǎn)換到場景,但是場景不能顯示你發(fā)送的數(shù)據(jù)。

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.

相同的結(jié)果也放生在當(dāng)你在prepareForSegue方法里拼寫了錯(cuò)誤的segue標(biāo)識符。當(dāng)segue缺失標(biāo)識符的時(shí)候,或者當(dāng)prepareforSegue方法使用不正確的標(biāo)識符的時(shí)候,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沒有應(yīng)用你的改變到這個(gè)場景。

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.

當(dāng)你點(diǎn)擊add 場景的導(dǎo)航條上的Done或者Cancel按鈕的時(shí)候沒有任何動作。確保每個(gè)按鈕已經(jīng)聯(lián)系到它的unwind action。在畫布中或賊文檔大綱中按住Control并點(diǎn)擊這個(gè)按鈕,并在Triggered Segues部分去人連接是被正確觸發(fā)的。

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.

文本字段使工作的,但你輸入的數(shù)據(jù)沒有顯示在主列表。確保視圖控制器的outlets已經(jīng)連接到文本字段。

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

使用代理的常見錯(cuò)誤是拼錯(cuò)委托方法的名字。即使你正確的設(shè)置了代理對象,如果在代理沒有在方法實(shí)現(xiàn)中使用正確的名字,正確的方法將不被調(diào)用。通常最好的方法是從可靠的來源(例如文檔或者頭文件里的聲明)復(fù)制粘貼代理方法聲明——例如textFieldShouldReturn:。

Next

Previous

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

標(biāo)題名稱:yourSecondiOSApp(5)—Troubleshooting-創(chuàng)新互聯(lián)
文章起源:http://bm7419.com/article12/dseidc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信小程序、定制網(wǎng)站、軟件開發(fā)、App設(shè)計(jì)、網(wǎng)站維護(hù)、網(wǎng)站策劃

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

營銷型網(wǎng)站建設(shè)