This column will be updated continuously — please pay attention to iOS friends!
(The answer is not unique, only for reference, there are benefits in the back of the article oh ~)
Portal:
IOS Basic Interview Questions 1
IOS Basic Interview Questions (2)
IOS Interview Questions (4)
1.When to use NSMutableArray and when to use NSArray?
When do I use NSMutableArray, when do I use NSArray?
Answer: use NSMutableArray if the array needs to change while the program is running, and use NSArray if the array is initialized and does not change again. It should be noted that using NSArray only means that the array does not change at run time, that is, you cannot add or remove elements from NSAarry’s array, but it does not mean that the contents of the elements in its array cannot change. NSArray is thread safe, NSMutableArray is not thread safe, so you have to be careful when multiple threads use NSMutableArray.
2.Give us example of what are delegate methods and what are data source methods of uitableview.
Give an instance of the delegate method and name the Data Source method of the UITableVIew
The answer: The UITableViewDelegate protocol is the target, the TableView is the adapter, and the UITableViewDelegate protocol is the target, the TableView is the adapter. The object that implements the UITableViewDelegate protocol, and sets itself as a TalbeView delegate, is the adapter, typically the UITableViewController. The DataSource method of the UITableVIew is a method of the protocol UITableVIew datasource
– (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger) Section;
TableView cell object: – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
3.How many autorelease you can create in your application? Is there any limit?
Is there a limit to how many AutoRelease objects you can create in your application?
Answer: no
4.If we don’t create any autorelease pool in our application then there any autorelease pool already provided to us?
If we do not create a memory pool, is there a memory pool available to us?
Answer: Interface threads maintain their own memory pool, user created data threads, need to create the pool for this thread
5.When you will create an autorelease pool in your application?
When do you need to create a memory pool in your program?
Answer: user created data thread, then need to create the memory pool for the thread
6.When retain count increase?
When does the memory count increase?
Answer: when an object is created and when a strong reference to the object is retained
7.What are commonly used NSObject class methods?
Which methods of class NSObject are often used?
Answer: NSObject is the base class of Objetive-c, which consists of the NSObject class and a set of protocols.
The class method alloc, class, object description method init, dealloc, – performSelector: withObject: afterDelay: etc are often used
8.What is convenience constructor?
What is the simple construction method?
Answer: Simple constructors are generally provided by the CocoaTouch framework, such as NSNumber + numberWithBool: + numberWithChar: + numberWithDouble: + numberWithFloat: + numberWithInt:
Most categories in Foundation have simple constructors. We can use simple constructors to get the objects created by the system without having to manually release them.
9.How to design universal application in Xcode?
How to design universal applications with Xcode?
The answer: Design an application using the MVC pattern, where the Model layer is completed out of the interface, that is, in the Model layer, which can run on any device, in the Controller layer, Select different viewController objects based on the features of the iPhone and iPad (exclusive UISplitViewController). In the View layer, according to the actual requirements, to design, where the XIB file design, its Settings as universal.
10.What is keyword atomic in Objective C?
When is the atomic keyword in objetive-c
Answer: Atomic, nonatomic, and nonatomic operations determine whether the setters and getters generated by the compiler are atomic operations
11.What are UIView animations?
What are the animation effects of UIView?
The answer: There are a lot of, Such as UIViewAnimationOptionCurveEaseInOut/UIViewAnimationOptionCurveEaseIn UIViewAnimationOptionCurveEaseOut / UIViewAnimationOptionTransitionFlipFromLeft UIViewAnimationOptionTransitionFlipFromRight UIViewAnimationOptionTransitionCurlUpUIViewAnimationOptionTransitionCurlDown
How to use visible this blog post
12.How can you store data in iPhone applications?
How do I save data in an iPhone app?
Answer: There are several preservation mechanisms:
1. Save the data on the server using the Web service
2. Save the object in the file through the NSCoder curing mechanism
3. Save in the file database through SQlite or CoreData
13.What is coredata?
What is CoreData?
Answer: The CoreData framework is a set of universal automated solutions provided by Apple, including object lifecycle, object diagrams, and persistence mechanisms.
Coredata provides a mechanism for easily mapping in-memory objects, and relationships between objects, to CoreData, which then persists the data for us. Compared with ordinary file database SQlite, it has more powerful functions. We don’t need to format the object data into SQL statements, store it in the database, and then read it out with select statement. Now, we only need to manage the managed objects of CoreData from memory.
It is Apple that provides a data preservation framework
14.What is NSManagedObject model?
What is an NS-managed object model?
Answer: NS-Managed object is a subclass of NSObject, which is an important part of Core Data. It is a generic class that implements the basic functions of the Core Data model layer. Users can subclass NS-Managed object to build their own data model.
15.What is NSManagedobjectContext?
What is nS-managed object context?
Answer: the NS-managed Object Context is responsible for the interaction between the application and the database.
16.What is predicate?
What is a predicate?
Answer: Predicate is through NSPredicate, is through the given logical conditions as constraints, complete the screening of data.
predicate = [NSPredicate predicateWithFormat:@"customerID == %d",n];
a = [customers filteredArrayUsingPredicate:predicate];
Copy the code
17.What kind of persistence store we can use with coredata?
What are the persistent storage mechanisms for CoreData?
Answer: This question is about the underlying storage mechanism in the CoreDate framework. Normally, when using CoreData, you would focus more on managed objects. Here are the details of the coerData framework’s storage implementation. BTW: Other common persistent storage methods: save to files, save to NSUserDefaults (system PLIST file).
IOS Interview Questions:
IOS Interview Collection + Answer (1)
IOS Interview Collection + Answer (2)
IOS Interview Collection + Answer (3)
IOS Interview Collection + Answer (4)
IOS Interview Collection + Answers (5)
IOS Advanced interview questions —-Block
IOS Advanced interview questions —- Multi-threaded
A learning route for iOS Developers (QQ.com)