12 IOS technical face questions and answers summary _ios

Source: Internet
Author: User
Tags gcd

Objective

With the continuous development and innovation of mobile internet technology, the interview is a time-consuming project for both the company and the developer or the designer, and it is filtered and summarized in the face of the problems that iOS developers and designers may encounter during the interview. Now let's take a look at it.

One, how to draw UIView?

The UIView most flexible way to draw is to draw it yourself. You are not actually drawing one UIView , but subclass one UIView and giving the ability to draw yourself. When a UIView drawing operation is needed: The drawRect method is invoked, overriding this method to give you the opportunity to draw the operation. When drawRect : The method is called, and the context of the current graphic is also set to the graphical context of the view, you can use the core graphic or Uikit method to draw the graphic in that context.

Second, what is MVVM? What is the main purpose? What are the advantages?

MVVM is Model-view-viewmodel

1. View mainly used for interface rendering, interacting with user input devices,

2. ViewModel is the most important part of the MVVM architecture, ViewModel including attributes, methods, events, attribute validation, and other logic, responsible for View Model communication with

3. Model is the data model that we often say, used for data construction, data drive, mainly provide the attributes of the underlying entity.

The main purpose of MVVM is to separate views and models

MVVM Advantages: Low COUPLING, reusable, independent development, testable

The difference between GET request and POST request

1. A request for data from a get server, and a post request to submit data to the server

2. get no request body, post have request body

3. The requested data is exposed to the address bar and the request is get post not, so post the security of the request is greater than the GET request number

4. The request has limits on the length of the get URL, and the post request is theoretically not limited to the length of the URL, but in practice the individual servers may specify limits on the size of the post submitted data.

Talk about your understanding of multithreaded development? Are there several ways to implement multithreading in iOS?

Benefits:

1. The use of multithreading can occupy a long time in the process of tasks into the background to deal with, such as pictures, video downloads;

2. To play the advantages of multi-core processors, concurrent execution allows the system to run faster, smoother, better user experience;

Disadvantages:

1. A large number of threads to reduce the readability of the Code;

2. More threads require more memory space;

3 When multiple threads are competing against the same resource, be aware of the problem of thread safety.

iOS has 3 kinds of multithreaded programming technology: 1. NSTHREAD,2.NSOPERATIONQUEUE,3.GCD;

Five, XMPP working principle; XMPP system characteristics

Principle:

1. All client messages and data from one to another client jabber are passed through the XMPP server

2. client linking to Server

3. server certification of the use of a local directory system certificate

4. server find, connect and authenticate each other

5. client interact with each other

Features:1 client/server communication mode, 2 distributed network, 3 simple client, 4 XML data format

Six, map positioning is how to achieve?

1. Import the Corelocation.framework

After 2.ios8, if you need to use the positioning function, you need to request user authorization, the first run will be balloon prompts

3. Obtain position information (i.e. longitude and latitude) by GPs with the machine

Seven, Apple internal purchase realization process

The program bundle gets a plist list of product identifiers through the stored files.

The program sends a request to the App Store to get information about the product.

The App Store returns product information.

The program displays the returned product information to the user (app's store interface)

User selects a product

Program sends payment request to App Store

The App Store processes payment requests and returns transaction completion information.

App gets information and provides content to users.

Eight, Alipay, micro-credit and other related types of SDK integration

1. Create applications and get AppID on Alipay development platform

2. Configure the key

3. Integrate and configure the SDK

4. Call interface (such as transaction query interface, transaction refund interface)

The cause of the deadlock in GCD and the method of unlocking it

Requirements for deadlock: 1. Mutually exclusive conditions, 2. Requirements and retention conditions, 3. Non-deprivation conditions, 4. Cyclic waiting conditions.

Workaround: use asynchronous execution block.

Ten, the steps to generate two-dimensional code

1. Using a CIFilter filter class to generate a two-dimensional code

2. Processing of the generated two-dimensional code to make it clearer

3. Custom two-dimensional code background color, fill color

4. Custom Positioning angle Mark

5. Insert small picture in two dimensional Code center

Xi. is there any difficulty in using the XMPP?

Send attachments (Pictures, voice, documents ...) ) is more troublesome

XMPP Framework does not provide the ability to send attachments, you need to implement

Implementation method, the file uploaded to the file server, upload a successful file to save the path, and then send the attachment path to friends

12, whether the use of the ring letter, simple next ring letter realization principle

Ring Letter is a service provider for instant Messaging

Ring Letter uses the XMPP protocol, it is XMPP on the basis of two development, the server OpenFire and client function model of the addition and the Client SDK encapsulation, the nature of the ring letter or the use of XMPP, socket based network communication

Ring letter inside the implementation of the data cache, the chat record will be added to the database, the attachment (such as audio files, picture files) to download to the local, so that programmers more time to spend on the user experience experience.

Summarize
The above is the entire content of this article, I hope this article on the content of iOS developers in the interview can help, if there are questions you can message exchange.

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.