iOS face question (iii)

Source: Internet
Author: User

1.When to use Nsmutablearray and when to use Nsarray?

When to use Nsmutablearray, when to use Nsarray?

Answer: When the array is running in the program, it needs to be constantly changing, using Nsmutablearray, when the array is initialized, it will not change, use Nsarray. It should be noted that the use of Nsarray only indicates that the array does not change at run time, i.e. it cannot add and remove elements to the Nsaarry array, but does not indicate that the contents of elements within its array cannot be changed. Nsarray is thread-safe, Nsmutablearray is not thread-safe, and multithreading is used to nsmutablearray needs attention.

2.Give US example of what is delegate methods and what is data source methods of UITableView.

Give an instance of the delegate method and say the UITableView data source method

Answer: Cocoatouch framework uses a large number of delegates, of which uitableviewdelegate is a typical application of the delegation mechanism, is a typical use of the delegate to implement the adapter mode, where the Uitableviewdelegate protocol is the target, TableView is an adapter that implements the Uitableviewdelegate protocol and sets itself to Talbeview delegate object, which is the adapter, in general, the object is Uitableviewcontroller.

UITableView's data source method has-(Nsinteger) TableView: (UITableView *) TableView numberofrowsinsection: (nsinteger) Section ;

-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) Indexpath;

3.How Many autorelease can create in your application? Is there any limit?

How many Autorelease objects can be created in the app, and is there a limit?

Answer: None

4.If we don ' t create any autorelease pool in US application and then are there any autorelease pool already provided?

If we do not create a memory pool, do we have a memory pool available to us?

Answer: The interface thread maintains its own pool of memory, and the user creates a data thread that needs to create a pool of memory for that thread

5.When you'll create an autorelease pool in your application?

When do I need to create a memory pool in my program?

Answer: A data thread created by the user himself needs to create a memory pool for that thread

6.When retain count increase?

When will memory count increase?

Answer: See iOS face question (i)

7.What is commonly used NSObject class methods?

Which methods of class nsobject are often used?

Answer: NSObject is the base class of Objetive-c, which is composed of NSObject class and a series of protocols.

Class methods Alloc, Class, Description object Methods init, Dealloc, –performselector:withobject:afterdelay: etc. are often used

8.What is convenience constructor?

What is a simple construction method?

Answer: The simple construction method is generally provided by the Cocoatouch framework, such as NSNumber + Numberwithbool: + Numberwithchar: + numberwithdouble: + numberwithfloat: + num Berwithint:

Most of the classes in the foundation have a simple construction method, we can get the system to create good objects by the simple construction method, and do not need to release manually.

9.How to design universal application in Xcode?

How do I design a generic app with Xcode?

Answer: Use the MVC pattern to design the application, where the model layer completes the detach interface, that is, in the model layer, it can be run on any device, in the controller layer, Choose different Viewcontroller objects based on the different features of the iphone and ipad (exclusive Uisplitviewcontroller). In the view layer, it can be designed according to the actual requirements, where the Xib file is designed, it is set to Universal

10.What keyword atomic in Objective C?

What is the atomic keyword when objetive-c?

Answer: atomic,nonatomic See iOS face question (i)

11.What is UIView animations?

What are the animated effects of UIView?

Answer: There are many, such as Uiviewanimationoptioncurveeaseinout Uiviewanimationoptioncurveeasein uiviewanimationoptioncurveeaseout     Uiviewanimationoptiontransitionflipfromleft Uiviewanimationoptiontransitionflipfromright Uiviewanimationoptiontransitioncurlupuiviewanimationoptiontransitioncurldown

How to use visible this blog

12.How can store data in IPhone applications?

How do I save data in the iphone app?

Answer: There are several preservation mechanisms:

1. Save on the server via the Web service

2. Save the object in a file by nscoder the curing mechanism

3. Save in the file database via SQLite or CoreData

13.What is CoreData?

What is CoreData?

Answer: The CoreData framework is a universal, automated solution offered by Apple, including object lifetimes, object graphs, and persistence mechanisms.

Supplementary answer: Above is translated, according to my personal understanding CoreData provides a mechanism that allows us to easily map objects in memory, and relationships between objects, to CoreData, and then to persist the data for us. Compared to the normal file database SQLite, it is more powerful, do not need us to format the object data into SQL statements, stored in the database, and then read with the SELECT statement, and now is from memory to coredata data management, We only need to manage CoreData managed objects.

Is Apple provides a set of data to save

14.What is Nsmanagedobject model?

What is a nsmanagedobject model?

Answer: Nsmanagedobject is a subclass of NSObject, is also an important part of CoreData, it is a generic class, to achieve the core data model layer required by the basic functions, the user can be sub-class Nsmanagedobject, Build your own data model.

15.What is Nsmanagedobjectcontext?

What is Nsmanagedobjectcontext?

Answer: The Nsmanagedobjectcontext object is responsible for the interaction between the application and the database.

16.What is predicate?

What is a predicate?

The answer: predicate is through the nspredicate, is through the given logic condition as the constraint condition, completes the filtering to the data.

predicate = [Nspredicate predicatewithformat:@ "CustomerID = =%d", n];

A = [Customers filteredarrayusingpredicate:predicate];

17.What kind of persistence store we can use with CoreData?

What kinds of persistent storage mechanisms are available in CoreData?

Answer: Coredatat provides several storage mechanisms: XML (not supported by iOS), automatic storage, SQLite, memory storage.

Supplementary note: This question asks is, the coredate framework storage mechanism, usually uses the CoreData, the more attention is managed object, here is Coerdata Framework's storage implementation detail. BTW: Other commonly used persistent storage methods: deposit to file, deposit to Nsuserdefaults (System plist file).

iOS face question (iii)

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.