iOS Development Learning notes (1)

Source: Internet
Author: User
Tags add numbers ftp protocol

OBJECTIVE-C Basic Summary 12th Chapter

1.application:didifinishlauchingwithoptions: Execute immediately after program starts

2. Start the Interface code format:
Self.window = [UIWindow alloc] initwithframe:[[uiscreen mainscreen] bounds];
1. Remove the version number from the Infor.plist
nstring *version = [NSBundle Mainbundle].infodictionary[key];
2. Remove the last saved version number from the sandbox
NSString *saveversion = [[Nsuserdefaults standaryuserdefaults] objectforkey:key];

if (([version isequaltostring:saveversion])) {
If the version is not used for the first time
Show status bar
Application.statusbarhidden= NO;
Waiting to write
Self.window.rootViewController = [[* * * alloc] init];


}
Else
{
The version number is different the first time you use the new version
Write the new version number to the sandbox
[[Nsuserdefaults Standarduserdefaults] setobject:version Forkey:key];
[[Nsuserdefaults standartuserdefaults] synchronize];
Display version new feature interface
Self.window.rootViewController = [[* * * alloc] init];
}
[Self.window makekeyandvisible];

return YES;

3. Managing snapshots: Xcode snapshots are a limited version control (for small to medium projects)

4.CGRectMake uses the first two values to indicate the position of the text label away from the top and bottom edges of the screen, and the last two values indicate the width and height of the text label

5.info.plist End File: Describes the properties of the project itself. Where you must set the icon for the application, the boot image, the supported device orientation, and so on. Project Navigator, visualization settings for numerous plist options

6. The graph for the general screen indicates icon.png, while the icon for the retina screen is called [email protected], and if it is required to display an image when the application is running on a device that uses the Retina screen, it will automatically use the containing suffix @2x ( An image resource with the same name as the specified name. This allows the developer to support the Retina screen without having to modify any of the application's code. You can also visualize the deployment Info section of the summary line card to set the boot image. For iphone, you can only set portrait-initiated images, but ipad supports landscape and portrait-initiated images.

7. Set status bar: State Bar is initially Hidden (default hidden status bar) no display status bar

Chapter III Exploring the Apple platform language objective-c

1. (1) OOP (object-oriented programming) uses an instruction type that is proportional to procedural programming, but organizes them to make the application easier to maintain and to reuse the code whenever possible. In OOP, you will create an object that stores data describing something and instructions for manipulating that data. (2) Another important aspect of OOP is the inheritance

2. Term Description:
Class: Code that defines an object and its functions, usually consisting of a header file/interface file and an implementation file.
Sub-category: Built on top of another class and added additional functionality. Almost anything you use in iOS development is a subclass of something else that inherits all of the functionality and properties of the parent class
"Superclass/Parent class: Class inherited by another class
Singleton: A class that can only be instantiated once throughout the lifetime of a program. For example, learn that the class facing the device is implemented as a singleton because there is only one sensor that returns to the information.
Object/instance: A class that is called in code and is in the active state. A class is a code that enables an object to work, and an object is a class that is active. Objects are also known as instances of classes.
"Instantiation: The process of creating an active object from a class
Example method: A basic function implemented in a class. For a reminder class, this could be the setalarm of setting an alert for a given reminder
Class method: Similar to an instance method, but with all objects created from the class.
Message: When you need to use an object's method, you send a message to the object, which is called a method of calling
Instance variable: The location where an object-specific information is stored.
"Variable: the location where information is stored. Instead of an instance variable, a regular variable is usually used only within the method that defines it.
Parameter: A piece of information that is provided to a method when it is called. If you want to invoke the set alert method for a reminder object, you must provide the time that you want to set. In this case, the time will be a parameter of the Setalarm method
Attribute: an instance variable configured with a special compilation directive that makes it easy to access it in code
Self: A way of referencing the current object in a method. When you use an instance method or property in an application, you must qualify it with a specific object. When you write code in a class that accesses its methods or properties, you can use self to refer to the current object.

3. The name of the interface file and implementation file for the class is usually the same as the class name. h interface file. m implementation file. A protocol is a feature that is unique to objective-c, and methods that need to be written are assembled together and identified with the same name, which is known as a protocol

The [email protected] compilation instruction is used in conjunction with another command named synthesize to simplify how the instance variables defined in the interface are interacted with. The role of @property and @synthesize is to set functions and get functions for writing, and is elegant and easy to use

5. Specify the attribute (strong,nonatomic) in the compile instruction @property to tell Xcode how to handle the property reference. The strong property (attribute) tells the system to keep the referenced object, rather than removing it from memory. The Nonatomic property tells Xcode not to worry about using the property at the same time for different parts of the application.

6.+ class method,-instance method.

7. Define method 1:+ (type of method return) method Name: (method expected information type) reference the variable name of the information, define method 2:+ (type of method return) method Name: (method expected information type) add a short description tag to the variable name that refers to the information: data type: variable name


8. ID types are useful if you don't know what to pass to a method or want to be able to return objects of different types from the same method

9. Combining @property and @synthesize allows us to access and modify instance variables in an intuitive way

[email protected] MyClass tells Xcode that the file implements that class

11. The use of the method is called to send information to the object

12. There are some (circular references) ARC cannot clean up, a reference b b refers to C C reference D D reference B Circular reference, a can use the object B but the BCD has a circular reference, you will not be able to free the three objects, to avoid such problems can use weak references (Weak reference)

Fourth chapter: Cocoa Touch Insider

1.Apple each iOS application template includes three important frameworks (Coregraphics, Foundation, UIKit)

2.Cocoa Touch Layer: (1) UIKit: Responsible for starting and ending applications, control interfaces, and multi-touch, and giving you access to common Data Views (Word Excel) (2) Map Kit: Lets developers add goodle map views to any application, including annotations , positioning, Event processing (3) Game Kit: Network interactivity (4) Message ui/address book ui/event Kit UI: Integration Requirements between applications (5) IAd: Enabling applications to join ads

3. Multimedia layer: (1) AV Foundation: Used to play and edit complex audio and video. such as movie recording, track management, and audio panning (2) Core Audio: Provides a way to play and record audio in the iphone (3) Core Image: Developers add advanced image and video processing features to the application (4) Core Graphics: Add 2D Reply and compositing features (5) Precise positioning and control of text displayed on the iphone screen (6) Image I/O: Importing and exporting image data and image metadata (7) Media player: Easily play movies using typical screen space (8) OpenGL ES: Create 2D 3D Animations (9) Quartz core is used to create animations: Take advantage of the device's hardware capabilities

4. Core Service Tier: (1) Accounts: Account information for storing many different services (2) Address Book: for direct access to and operation of the phonebook (3) Cfnetwork: Access to BSD sockets, HTTP and FTP protocol requests and Bonjour Discovery (4) Core data: Creating a data model provides a database model of sqlite relationships
(5) Core Foundation: Same as Foundation Framework (6) Foundation: Provides a wrapper (array of operations strings and dictionaries are all made through the foundation framework) (7) Event Kit: Accessing stored calendar information (8) Core location: For the iphone iPad 3G GPs get latitude and longitude and measurement accuracy
(9) Core motion: Managing most motion-related events: Using accelerators and gyroscopes Quick look: Implementing file Browsing (one) Store Kit: Create purchase physical (System) Configuration: Used to determine the current state of the device's network configurations


5. Core OS layer: (1) Accelerate: Simplified computing and big data operations tasks, including digital signal processing functions
(2) External accessory: An excuse for development to Accessories (3) Security: Provides execution encryption (add delete modifier key entry) (4) System: Access to some typical tools in the Unrestricted UNIX development environment

6. Root class (NSOBJCT) application Class (UIApplication) window class (UIWindow) view (UIView) responder (uiresponder) screen control (Uicontrol) view Control diagram Uicontroller

7. String nsstring/nsmutablestring where nsmutablestring is available and creates a string that can be modified. NSString cannot be changed after initialization, nsmutablestring can be modified (extended, shortened, replaced, etc.)

8. Array (Nsarray/nsmutablearray)

9. Dictionary (nsdictionary/nsmutabledictionary) dictionary exists as a key-value pair

10. Numbers (Nsnumber/nsdecimalnumber) can easily add numbers as objects into an array or dictionary, Nsdecimalnumber is a subclass of NSNumber

11. Date (NSData)

12. URLs (URLs)

13 Interface class: Label (UILabel) button (UIButton) switch (uiswitch) segment Control (Uisegmentedcontrol) slider (uislider) step Control (Uistepper) text box (uitextfield/) Uitextview) Selector (uidatepicker/uipicker) pop-up box (Uipopovercontroller)

Fifth chapter: Cocoa Touch Insider

1. Instantiation refers to the creation of an instance of an object that allows you to use it in your program to get all the functionality of its class

2.IB (Interface Builder) Storyboard Open Storyboard Displays the file skeleton of the storyboard

The sixth chapter: Model-View-controller application design

1. The view controller can contain application logic, but this does not mean that all code is contained in the view controller. Additional classes can be defined at the time of verification, abstract application logic

2. Use Iboutlet: To allow code to interact with objects in the view (for example: @property (strong,nonatomic) Uilbel *mylabel1 with: @property (strong,nonatomic) Iboutlet Uilbel *mylabel1 supporting use)

3. For each compilation instruction in the interface file. h @property implementation file. m must have corresponding compilation intelligence high @synthesize

4. Use ibaction: to indicate that the appropriate method in the code should be called when a particular event occurs. (for example, if a user taps a button or updates a text box), take the appropriate action

5.appdelegate.h and APPDELEGATE.M make up the delegate for the Uiappkucation instance that the project will create, edit the file, and add methods to control how the application runs.

6.viewcontroller.h VIEWCONTROLLER.M implements a view controller (Uiviewcontrooler) This class contains logic to control the attempt.

7. When you are finished using an attempt, the instance variable defined in the code no longer points to the object. You can set the property of the instance variable to nil so that the memory used by these text boxes and labels can be reused

iOS Development Learning notes (1)

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.