IOS interview questions A total of pen tests and test divides into two parts Pen test A total divided into 10 items 613 interview questions in a total of 400 pen try a 10 series, respectively (1) items (syntax), a total of 147 has been updated (2) items (common sense), a total of 72 has been updated (3) items (interface), a total of 83 has been updated ④(iOS) 52 questions ⑤(Operations) 68 questions ⑥(Data Structure) 23 questions ⑦(Multi-threading) 60 questions ⑧(Networking) 22 questions ⑨(multimedia) 59 questions ⑩(security) 27 questions The total number of questions is divided into three, totaling 400, for example, 127, for example, 127, for example, 2/3, for example, 137, for example, for 136, for example, 3/3
@TOC
Question 613
⭐️
1.The UIViewController didReceiveMemoryWaring
When methods are called :[single choice]
- A. External call
- B. System error
- C. The system memory is insufficient
- D. The CPU usage is 100%
2. Which of the followingclass
During iPhone app developmentCan't
Use :[Multiple choice]
- A, UITableViewController
- B, UINavigationController
- C, UISplitViewController
- D, UITableViewController
3. The following is not the standardUIButton
The types are :[Single choice]
- A, UIButtonTypeRoundedRect
- B, UIButtonTypeContacAdd
- C, UIButtonTypeRadio
- D, UIButtonTypeInfoLight
4. When setting UIButton image, in order to adapt the image to the size of the button, the button contentMode should be set to :[Single choice]
- A, UIViewContentModeScaleToFill
- B, UIViewContentModeScaleAspectFit
- C, UIViewContentModeScaleAspectFill
- D, UIViewContentModecenter
About 5.UIControl
andUIView
The following statement is true:
- A, UIcontrol inherits from UIView
- B. UIView inherits from UIcontrol
- C, UIcontrol has no inheritance relationship with UIView
- D, UIcontrol, and UIView inherit directly from UIResponder
6. The followingUIView
Which of the methods isiOS5.0
Before and afterThe system call mechanism is different
:[Multiple choice]
- A, addSubView
- B, layoutSubView
- C, drawRect
- D, removeFromSuperView
7. To constructUIImage
In the method of,Maximum memory usage
Which method of :[Multiple choice]
- A, imageNamed
- B, imageWithContentsOfFile
- C, imageWithData
- D. They are the same size
8. Which of the following methods areUITableView
thedelegate
Methods :[Multiple choice]
- A, (NSInteger) tableview: (UITableView) tableview numberOfRowsInSecion (NSInteger) section;
- B, (UITableViewCell *)tableview:(UITableView)tableview cellForRowAtIndexPath:(NSIndexPath *)indexPath;
- C, (CGFloat)tableview:(UITableView)tableview heightForRowAtIndexPath:(NSIndexPath *)indexPath;
- D, (void)tableview:(UITableView)tableview didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
9.UIResponder
isUIView
The parent class? :[Multiple choice]
- A, right
- B, errors,
10.UIControl
isUIView
The parent class? :[Multiple choice]
- A, right
- B, errors,
11.UITableView
In the cellreuse
Are composed of severalAn array of
Achieved :[Single choice]
- 1 A,
- B, 2,
- C, 3
- D, 4
12. ClickButton
Response chain
[Multiple choice]
- A, window
- B, Application
- C, AppDelegate
- D, UIViewController
In 13.UIKit
,frame
andbounds
The difference is :[multiple choice]
- A, Frame is an alias of bounds
- B. Frame is a bounds descendant
- C. The frame reference frame is the superview coordinate system, and the bounds reference frame is its own coordinate system
- D. The reference frame of the frame is its own coordinates, and the reference frame of the bounds is the coordinates of the superview
14.UIViewController
In the display process, the various methodsCall to order
Yes :[Multiple choice]
- A, init -> viewDidLoad -> viewDidAppear -> viewDidUnload
- B, init -> viewDidAppear -> viewDidLoad -> viewDidUnload
- C, init -> viewDidLoad -> viewDidUnload -> viewDidAppear
- D, init -> viewDidAppear -> viewDidUnload -> viewDidAppear
Use 15.imageNamed
Method to create a UIImage object, and the normalinit
What are the differences in methods:
- A. No difference. Just for convenience
- The imageNamed method just creates a pointer and allocates no memory
- C. The imageNamed method loads the image into memory and does not release it
- D. The imageNamed method will be released immediately after using the image
16. In the absencenavigationController
In the case of oneViewController
switch
To anotherViewController
Do :[Multiple choice]
- A, [self navigationController pushViewController: nextViewController animated: YES];
- B, [the self view addSubview: nextViewController. View];
- C, [self pushViewController: nextViewController animated:YES];
- D, [self presentModalViewController: nextViewController animated: YES];
17. What iskey window
:[Multiple choice]
- A, the only UIWindow object in the App
- A UIWindow with a key can be specified
- C, UIWindow that can receive events such as keyboard input
- D. the UIWindow object that cannot be hidden
18.UIButton
Inheritance from subclass to parent class once from:
- UIView -> UIViewController -> UIcontroller
- UIResponder -> UIControl -> UIView
- C, UIControl -> UIResponder -> UIViewController
- D, UIControl -> UIView -> UIResponder
19. The following is aboutUIView
andCALayer
Correct description :[Multiple choice question]
- A UIView can be displayed because of the CALayer object inside it.
- The real drawing part of UIView is managed by a CALayer class.
- C. Add shadows, rounded corners, border width and color to UIView without going through CALayer.
- D, access UIView root plot and coordinate related properties, such as frame, bounds, etc., are actually internal access to it contains CALayer related properties.
20.UIWindow
Provides a surface for drawing content, which is the root container for all other views, per applicationYou can only have one window
? [D].
- A, right
- B, errors,
21.UIView
The view is the parent class of all controls. Controls are used to respond to user interactions, while UIView is responsible for the display and layout of content. [D].
- A, right
- B, errors,
22.UIControl
Class is the parent of almost all interactive controls, such as buttons, sliders, text boxes, and so on. So the UIControl class is responsible for triggering actions based on touch events, right? [D].
- A, right
- B, errors,
23. Created after the iOS app startsThe first view control
isUIWindow
? [D].
- A, right
- B, errors,
24. In iOS apps,Window object
Did not likeClose the dialog
orTitle box
Such an area, so the user cannot directly perform on itShut down
? [D].
- A, right
- B, errors,
In 25.macOS
,NSWindow
Is the parent classNSResponder
. iniOS
In the system.UIWindow
Is the parent classUIResponder
? [D].
- A, right
- B, errors,
26.macOS
,NSWindow
Is the parent classNSResponder
. iniOS
In the system.UIWindow
Is the parent classUIView
? [D].
- A, right
- B, errors,
27.UIView
thealpha
A property is aFloating point value
, the value ranges from 0 to 1.0Completely transparent
toCompletely opaque
[D].
- A, right
- B, errors,
28. When will beUIView
thealpha
Property set to0
After that, the following description is correct :[Multiple choice]
- A, the current UIView and its subviews are hidden, regardless of the alpha value of the view.
- B. The current UIView is hidden, and the child view is not affected by the alpha value of the parent view.
- C. The current UIView will not be removed from the responder chain. You can still accept touch events.
- D. The current UIView is removed from the responder chain. And the next person in the responder chain will be the responder.
29. When will beUIView
theisHidden
Property set totrue
After that, the following description is correct :[Multiple choice]
- A, the current UIView and its subviews are hidden, regardless of the hidden value of the view.
- B. The current UIView isHidden and the child view is not affected by the parent view’s isHidden value.
- C. The current UIView is removed from the responder chain. And the next person in the responder chain will be the responder.
- D. The current UIView will not be removed from the responder chain. You can still accept touch events.
30. By default, when adding a subview to a view, if the area of the subview exceeds the area of the parent view, the portion of the subview that exceeds the area of the parent view will still appear on screen as normal. [D].
- A, right
- B, errors,
31. InIOS Coordinate System
In coordinatesThe origin
Located at :[Multiple choice]
- A, the lower left corner
- B. Upper right corner
- C. upper left corner
- D. Lower right corner
About 32.UIView
theframe
andbounds
Attribute, the following description is correct :[Multiple choice]
- A, the frame(Origin,size) property of A UIView defines A rectangle that describes the size of A UIView and the position of its parent frame.
- B. The frame(Origin,size) property of UIView defines a rectangle that describes the size of a UIView and the position of its own coordinate system.
- C, UIView’s bounds(Origin,size) property defines a rectangle that describes the size of a UIView and the position of its own coordinate system.
- D, UIView’s bounds(Origin,size) property defines a rectangle that describes the size of a UIView and the location of its parent coordinate system.
33. In the rightUIView
View toZoom in, out or rotate
At the right time.center
The value of the property occurschange
? [D].
- A, right
- B, errors,
34. ByCGAffineTransform
affineconversion
, what can be done to UIView viewtransform
Operation :[multiple choice]
- A, zoom
- B, rotation,
- C, hidden
- D, displacement
35.UIViewController
Contains the followingfunction
? [Multiple choice]
- The UIViewController class is responsible for creating the views it manages and removing them from the content when memory is low.
- B. New view content can be displayed as a modal window above the current view through the view controller.
- C. View controller can respond to device direction changes and adjust the view accordingly. To adapt to the new direction.
- D. Some special view controllers, such as navigation view controller and label view controller, can make view management more convenient and standardized.
About 36.UITabBarController
Are the following statements correct? [Multiple choice questions]
- A. UITabBarController cannot be added to other view controllers.
- B. UITabBarController can be added to other view controllers.
- C, UITabBarController’s Tab bar can be placed at the bottom or top of the screen.
- D. The Tab bar of UITabBarController can only be placed at the bottom of the screen.
About 37.UINavigationController
Are the following statements correct? [Multiple choice questions]
- A, UINavigationController Navigation controller is used to display multi-screen and hierarchical content and is the main tool for building divided applications.
- B. UINavigationController maintains a stack of view controllers, with all the child view controllers on the stack.
- C. In contrast to UITabBarController, UINavigationController is implemented as a stack. It is better suited for processing and displaying hierarchical data.
- D, UINavigationController The navigation controller manages, cuts, and slices multiple content pages, similar to UITabBarController.
38.UIControl
Of the classUIControlEvent
What are the three main typesThe event
? [Multiple choice]
- A. Notification based control events
- B. Based on the worth control event
- C, touch based control events
- D. Edit-based control events
39.UIButton
isUIView
A subclass of? [D].
- A, right
- B, errors,
40.Target - the Action mechanism
Can apply to the same controlThe binding
multipleAction
[D].
- A, right
- B, errors,
41. If your view is not specifiedtintColor
Property, then this use will be usedThe parent class
In thetintColor
Attribute? [D].
- A, right
- B, errors,
42.UIButton
bytintColor
The range of influence istitle
andimage
thecolor
? [D].
- A, right
- B, errors,
43. The following is concerningNSLineBreakMode
theThe enumeration
Members, correctly described are :[Multiple choice questions]
- A, ByWordWrapping means that the display unit is words, the back part is omitted and not displayed
- B. ByCharWrapping displays characters as the display unit. The following parts are omitted
- C. ByClipping indicates that the content length is the same as the width of the text and the last part is deleted
- D. ByTruncatingHead indicates that the beginning is omitted and the tail text content is displayed
44.UISwitch
theThe size of the
Setting isinvalid
[D].
- A, right
- B, errors,
45.UITextField
Support for proxy modedelegate
, but not supportedTarget - the mechanism of Action
? [D].
- A, right
- B, errors,
46.UITableView
Can be used in the following situations :[Multiple choice]
- A. Convenient for users to browse hierarchical data
- B. Provide a list of alternatives
- C, display a series of data index list
- D. Use group structure to display details and more detailed Settings
47. Developers can be rightUITableViewCell
What to do :[Multiple choice]
- A. Customize the text title, icon and background light properties of the cell.
- B. Select and highlight the cells.
- C. Configure the attachment view of the cell.
- D. Add, delete and change the position of cells.
48. The following is relevantUICollectionView
andUICollectionViewController
, correctly described :[Multiple choice]
- A, UICollectionView and UICollectionViewController class is iOS 6 newly introduced API.
- B. The standard UICollectionView object includes three parts: Cells, Supplementary Views and Decoration Views. These three parts are subclasses of UIView.
- The C, UICollectionView class is responsible for managing an ordered collection of data and rendering it using a custom layout model.
- In addition to multi-column layouts, UICollectionView can also achieve tiled layouts, circular layouts and more custom layouts.
49.iOS
There is only inheritance inUIResponder
Class to be processedtouch
Event? [D].
- A, right
- B, errors,
50.UIViewController
View controller,UIApplication
Are allinheritance
Since theUIResponder
? [D].
- A, right
- B, errors,
51. IfUIWindow
Object cannot handle a touch event, the touch event is discarded. True Or false
- A, right
- B, errors,
52.UIGestureRecognizer
Class contains which of the following gestures:
- A, UIPanGestureRecognizer
- B, UIRotationGestureRecognizer
- C, UILongPressGestureRecognizer
- D. UISwipeGestureRecognizer.
53.UITapGestureRecognizer
Belong toDiscontinuous type
The gesture? [D].
- A, right
- B, errors,
54.UIPinchGestureRecognizer
Belong toDiscontinuous type
The gesture? [D].
- A, right
- B, errors,
55.Storyboard
The story edition feature is available inWhich iOS version
Published :[Multiple choice]
- A, ios
- B, ios 5,
- C, iOS6
- D, iOS7
56. The following pairsStoryboard
The story version features the correct description of [multiple choice]
- A. You can make learning easier by simply dragging and dropping various interface controls to the view controller. Provides efficiency and fun for development efforts. Make development work more human.
- B. You can better view and understand the appearance of all pages in the project and the link jump relationship between pages.
- C. Storyboard quickly implements jump relationships between views.
- D. By rewriting the prepareForSegue method, all jump logic of view controller is gathered together to facilitate unified interface jump and parameter transfer.
57. The following pairsStoryboard
The story version features the correct description of [multiple choice]
- A. Storyboard uses Cell ProtoType and Static Cell features to make table controllers easier to implement
- B. In Storyboard, constraints can be established by drag and drop to quickly achieve adaptation of various resolutions.
- C. As a Storyboard contains more and more view controllers, it will be slower and slower to open.
- D. Modularization and reuse of functions can be achieved by separating common functions such as registration and sharing modules into a Storyboard.
58.Storyboard
In fact, byXML
Text files made up of extensible Markup Language
[D].
- A, right
- B, errors,
Use 59.Single View Application template
Create the project that willBring their own
Which twoStoryboard file
? [Multiple choice]
- A, Home. The storyboard
- B, the Main storyboard
- C, the Index. The storyboard
- D, LaunchScreen. Storyboard
60. Which of the following marks represents fromstoryboard
theThe connection
Methods? [Multiple choice]
- A, @ IBMethod
- B, @ IBOutlet
- C, @ IBAction
- D, @ IBProperty
In 61.LaunchScreen.storyboard
In the story version, you can’t use UIWebView, because you can’t use webView here. [D].
- A, right
- B, errors,
62. Can provideIPhone
andiPad
Specify differentLaunchScreen.storyboard
[TRUE]
- A, right
- B, errors,
63.LaunchScreen.storyboard
The story version can use UIView or UIViewController, but custom subclasses can’t, okay? [D].
- A, right
- [] B
64.CALayer
Is defined in thatThe framework
In the? [Multiple choice]
- A, UIKit
- B, Foundation,
- C, QuartCore
- D, the Core Image
65. Pass the operationCALayer
Object, which interface properties of UIView can be easily adjusted? [Multiple choice]
- A, the shadow
- B, rounded corners,
- C, border
- D. gradual discoloration
66.UIColor
,UIImage
Which is the definitionThe framework
[Multiple choice]
- A and Foundation.
- B, CoreGraphics
- C, UIKit
- D, the Core Image
67.UIKit
IOS only, not macOS? [D].
- A, right
- B, errors,
68.QuartCore
The framework can be used directlyUIColor
,UIImage
? [D].
- A, right
- B, errors,
69.CALayer
andUIView
The same can be done with userstouch
Event? [D].
- A, right
- B, errors,
70.UIView
Can be achieved bysubviews
Property accessAll the subviews
Similarly,CALayer
Also throughsublayers
Property to access allsub-layer
? [D].
- A, right
- B, errors,
71.UIView
Can be achieved bysuperview
Property accessParent view
Similarly,CALayer
Also throughsuperlayers
Property to access allThe parent layer
? [D].
- A, right
- B, errors,
72. If twoUIView
isFather and son
So what’s inside of themCALayer
Is alsoFather and son
? [D].
- A, right
- B, errors,
Because 73.UIView
The object is already at its internal root leveldelegate
, so can not be in aUIView
Set up theCALayer
thedelegate
? [D].
- A, right
- B, errors,
74.UIKit
In the framework ofIOS Architecture
Which floor? [Multiple choice]
- A. Core OS Layer
- B. Core Services Layer
- C. Media Layer
- D. Cocoa Touch Layer
75.iOS
What kind of user interface do you haveCreate a way
? [Multiple choice]
- A, Xib
- B, Storyboard
- C, PhotoShop
- D. Code creation
76.IPhone X
What is the resolution ratio of? [Multiple choice]
- A, 4:3
- B, 16:9
- C, and
- D, o
77. The following is relevantIPhone X
Is the size description correct? [Multiple choice]
- A. Height increased by 145pt to 812pt
- B. Status bar height changed from 20pt to 44pt
- C. Physical resolution 1125px by 2436px
- D. The iPhoneX has a 5.8-inch screen
78.iOS11
The default height of the navigation bar was? [Multiple choice]
- A, 32 pt
- B, 48 pt
- C, 64 pt
- D, 96 pt
79.iOS11
Then if set fromprefersLargeTttles = YES
, the height of the navigation bar is? [Multiple choice]
- A, 32 pt
- B, 48 pt
- C, 64 pt
- D, 96 pt
In 80.iOS11
If black appears around the icon when the APP starts, it is because the four corners of the icon are rounded and surrounded by transparent pixels. [Multiple choice]
- A, right
- B, errors,
81. Which of the following attributes isiOS11
It was introduced in the beginning to controlsafeAreaInsets
Whether or not tolayoutMargins
On [multiple choice]
- A, layoutMargins
- B, directionalLayoutMargins
- C, preservesSuperviewLayoutMargins
- D, insetsLayoutMarginsFromSafeArea
82. Which of the following attributes isiOS8
Introduced at the beginning, used to specifyview
And it’sChild views
Between themargin
[Multiple choice]
- A, layoutMargins
- B, directionalLayoutMargins
- C, preservesSuperviewLayoutMargins
- D, insetsLayoutMarginsFromSafeArea
83.LayoutSubViews
When is it called? [D].
- A. When the frame of the View itself changes
- B. When the View itself changes bounds