IOS interview questions (2) and ios interview questions
1. Q &
1. Functions of readwrite, readonly, assign, retain, copy, and nonatomic attributes.
2. When to use delegate and Notification?
Iii. Target-Action Mechanism
4. When is the loadView, viewDidLoad, and viewDidUnload of ViewController called? What should I do in the Custom ViewController functions?
5. What is the difference between # import and # include? What is the difference between @ class and # import <> and # import?
6. What is a single-piece instance?
7. What is the difference between shallow replication and deep replication?
8. What is the difference between a method and a selector?
9. What is the difference between frame and bounds?
10. usage of the inputView and inputAccessoryView attributes of UITextField.
2. single answer
I. What is the file management class in ios ()
A. UIFileManager. B. NSFile C. NSFileMangager D. UIFile
2. Which of the following is a mutable object ()
A. NSString B. NSArray C. NSMutableDictionary D. NSSet
3. The instruction for starting a class implementation is ()
A. @ interface B. @ protocolC. @ implementation D. @ property
4. The parent class of UITableView is ()
A. UIView B. UIScrollView C. UIResponder D. NSObject
5. The method for refreshing a UIView is ()
AinitWithFrame B loadView C. drawRect D. setNeedsDisplay
6. The Initialization Method of the UINavigationController class. The parameters accepted by initWithRootViewController cannot be instances of the following class ()
A. UIViewControllerB. UITableViewController C. UITabBarController D. UINavigationController
7. Which of the following statements about thread management errors is ()
A. GCD uses more overhead than NSThread.
B. You can modify the UI element in the Child thread.
C. NSOperationQueue is a higher level encapsulation than NSthread
D. GCD can allocate threads according to different priorities.
8. What is a key window? ()
A. The unique UIWindow object in the App
B. You can specify the UIWindow of a key.
C. Access the UIWindow that receives events such as keyboard input.
D. The UIWindow object that cannot be hidden
9. In Xcode, You need to compile the source code files of mixed Objective-C and C ++, and change the suffix of the file format ()
A. c B... cpp C... mm D... m
10. When UIViewController is displayed, the call sequence of each method is ()
A. init-> viewDidLoad-> viewDidAppear-> viewDidUnload
B. init-> viewDidAppear-> viewDidLoad-> viewDidUnload
C. init-> viewDidLoad-> viewDidUnload-> viewDidAppear
D. init-> viewDidAppear-> viewDidUnload-> viewDidLoad
3. Code questions
1. Use a circular statement to calculate the sum of values at the positions of the following two-dimensional array diagonal lines (from the upper right corner to the lower left corner, that is, 4 + 7 + 10 + 13)
IntvalueArray [4] [4] = {
{1, 2, 3, 4 },
{5, 6, 7, 8 },
{9, 10, 11, 12 },
{13, 14, 15, 16 },
}
Ii. Implement UITableViewCell