Learning Ios:3

Source: Internet
Author: User

This lesson does not add too many new points of knowledge to the previous lesson, or complements the content of the card game in accordance with MVC's design principles. Here are a few points to note.

1. ReadOnly: Declaring a property as ReadOnly indicates that this property is not a setter method, which is read-only from the outside, and that it can be modified by re-declaring the property as ReadWrite in the internal implementation. 2. After adding another 11 cards, when setting their action and outlet, all the Cardbutton objects are connected to outlet and placed in a iboutetcollection, beginning to not understand, Think it's not supposed to be a button an action, or to connect to a ibactioncollection, and later understand that outlet is like a UI element in a controller alias, the reference to it directly to the UI element we want to, For Ibaction, it has a certain type of parameter sender, which can be an element such as Id,uibutton, which is used to determine the object that generated the event. You can determine the position of this UIButton object in Iboutletcollection to set the state of the corresponding model and update the UI. 3. After the code is knocked out, there is no expected effect, and when you click on the card, the score decreases, but the card does not flip. Later after analysis and single-step debugging, found in the initialization of the card Initwithcardcount simultaneous is 0, and did not put the correct number of cards passed, modified to solve the problem. This is a preliminary understanding of Xcode debugging iOS programs.   In addition, the knowledge points for the "development process", "Designing a User Interface" "Defining the Interaction" chapters of "beginning" are organized as follows: Develop Process This chapter introduces the creation of an app from scratch, which is basically generating ideas, designing the UI (intuitive use of storyboard), Implementing Interaction (Controller), Managing data (model)  designing a user Interface1. The view Hierarchy:view is layered, and the parent view contains child view, just like a tree, at the top is the Window object (UIWindow object), Window object does not display the content, If you want to display content, use content view, and if you want to be visible to the user must add this content view to the view hierarchy, when you use storyboard design, this operation has been automatically done for you. 2. View contains varioustypes, you can divide them into categories: content (contents, images, text, etc.), collections (collection, combinations of other view), controls (control, buttons, etc.), bar (toolbars, navigation bars, etc.), input (Text,search, etc.), Container (containers).  defining the Interaction1. Action and outlet, see here Action and outlet solution to add the card is to set the action or outlet doubts 2. Navigation Controller: It manages to move forward or backward in a series of view controllers, just like a stack, and the usual pop operation (that is, back from the current controller) can be done automatically by the Back button, The push (the current controller advances to the next controller) is set to completion (via Storyboard). The segue introduced here is not yet an intuitive understanding of the follow-up look.  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.