(1/18) re-learn Standford_iOS7 development _ iOS overview _ course notes, standford_ios7_ios

Source: Internet
Author: User
Tags key string

(1/18) re-learn Standford_iOS7 development _ iOS overview _ course notes, standford_ios7_ios

Preface: the last course I learned was a bit confusing for iOS. Due to lack of practice, I sometimes cannot understand the knowledge well when I watch videos in open classes. It is always the best way to learn with questions. After a period of iOS development, I will come to the Stanford iOS open class again. There will be many new discoveries and new understandings of existing concepts. This course notes are mainly used to summarize knowledge points, organize learning ideas, and discuss exercises and exchange ideas with you.

  Lesson 1: iOS Overview

    1. iOS layering: ① Core OS: Core operating system layer, based on UNIX kernel (socket, file system, power management, key string, Bonjour, etc ). Most APIs are C functions, which are rarely used in actual applications.

② Core Servers: the Core service layer (array, Dictionary, String, object-oriented file system, multithreading, GPS, database, etc.) is widely used.

③ Media: the Media layer (video, image, audio editing, etc.) is widely used.

④ CocoaTouch: The touch application layer (controls such as buttons, text boxes, interactive animation, localization, cameras, and web browsing views) is used in many ways.

    2. Development related:① Tool: Xcode

② Language: objective-C

③ Framework: Foundation, CoreData, MapKit, UIKit, CoreMotion, etc.

④ Design pattern: MVC (recommended). Other pattern will also be used in subsequent courses, and MVC will always run through.

    3. MVC design mode:Model, View, and Controller: a policy that organizes classes in an application. All classes are divided into one of the three.

Model = What your application is (but not how it is displayed)

Controller = How your Model is presented to the user (UI logic)

View = Your Controller's minions

As shown in:

Communication Method: ① The controller directly operates the Model and can directly use its API

② The controller directly operates the View and can directly use its API through outlet.

③ Communication between Model and View is prohibited. (The model is completely independent from the UI)

④ View cannot communicate directly with the Controller, but uses the following indirect methods: target-action (such as buttons and slide bars), Protocol (delegate) or Data Source (dataSource): protocol (such as tableview ).

⑤ The Model cannot communicate directly with the Controller, but communicates through the Notification or KVO mechanism.

Multiple MVC scenarios are shown in:

    4. objective-C

① Strong & weak: strong: if a strong pointer points to an object, the object will be kept in the heap. When no strong pointer points to the object (nil), the object will be released.

Weak: when no strong pointer points to an object (or a weak Pointer Points to an object), release the object.

② Nonatomic: Non-atomicity, indicating that this object is not thread-safe. If it is atomic, it will be locked in the setter and getter methods of the attribute, affecting performance.

    5. Source Code

Card. h

1 # import <Foundation/Foundation. h> 2 3 @ interface Card: NSObject4 @ property (strong, nonatomic) NSString * contents; 5 @ property (nonatomic, getter = isChosen) BOOL chosen; 6 @ property (nonatomic, getter = isMacthed) BOOL matched; 7 8-(int) match :( NSArray *) otherCards; 9 @ endCard. h

 

Card. m

1 # import "Card. h "2 3 @ interface Card () 4 5 @ end 6 7 @ implementation Card 8 9-(int) match :( NSArray *) otherCards10 {11 int score = 0; 12 13 for (Card * card in otherCards) 14 {15 if ([card. contents isinclutostring: self. contents]) 16 {17 score = 1; 18} 19} 20 21 return score; 22} 23 24 @ endCard. m

 

    6. Job:None

 

Course video address: Netease Open Class: http://open.163.com/movie/2014/1/M/7/M9H7S9F1H_M9H7TMJM7.html

Or use iTunes U to search for standford courses

 

Related Article

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.