SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
|
Email
Search
Test your basic knowledge |
iOS 5 App Development 2
Start Test
Study First
Subjects
:
it-skills
,
apple
Instructions:
Answer 50 questions in 15 minutes.
If you are not ready to take this test, you can
study here
.
Match each statement with the correct term.
Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.
This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
Import / handle multiple inclusion.
In the getter! This is called lazy instantiation.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
NSLog; %@; %d and other formatters
2. What about the view talking to the controller?
3. How is ARC done?
The compiler adds code to count references.
Interface; Implementation
A framework.
Outlet; Action
4. How are local variables initialized in iOS 5?
To zero; so pointers are nil.
Class XX = [Object class]
Import / handle multiple inclusion.
Controls how the model is presented onscreen.
5. Some controllers have ____________ as their views.
Other MVC trios.
constant NSString
[Object isKindOfClass:[Classname class]]
Two floats - for width and height
6. Talk about BOOL variables.
Instance method; class method.
No...but it has 'a way' to notify the controller to come ask for fresh data.
NO is zero; YES is anything else.
The document; possibly a database.
7. What do I use for a bag of bits?
iOS; when the view is loaded.
NSData
A rectangular area
One; zero to many
8. What does 'weak' mean?
9. What about public/private in Objective-C?
10. How many superviews does a view have? How many subviews?
(1) We can validate (e.g. bounds-check) any sets done by a subclass. (2) We can lazily instantiate - so things only get created if and when they are needed.
Points - to achieve device-independence
UIWindow
One; zero to many
11. How can I find out the class of any object? Give a line of code.
self.view
Class XX = [Object class]
Two CGFloats for x and y
Controls how the model is presented onscreen.
12. Class methods are used for ___________ and the call starts with ____________.
addSubview; removeFromSubview
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Wrap it in NSValue. And remember that NSValue immutable.
(1) We can validate (e.g. bounds-check) any sets done by a subclass. (2) We can lazily instantiate - so things only get created if and when they are needed.
13. The view is...
14. What is a reason to write our own setter?
Argument validation.
NSLog; %@; %d and other formatters
internal origin and size. Use this inside a view
constant NSString
15. Does a view 'own' the data it displays?
Two CGFloats for x and y
Outlet; Action
No - it gets the data from the controller.
Can handle any language because it uses Unicode.
16. What is the bounds property of a UIView?
Nothing happens - and nil is returned.
'Keep this in the heap until I don't point to anymore.' I won't point to it anymore if I set my pointer to nil - or if I am removed from the heap because no one points strongly to me.
internal origin and size. Use this inside a view
Right-click on view - or even a subview like a button.
17. If I need to convert a number to an object - use __________
Instance variable (ivar) or 'backing variable'
Never!
Two floats - for width and height
NSNumber. For example numberWithDouble: and doubleValue:
18. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Import / handle multiple inclusion.
Instance method; class method.
A framework.
UIViewController.
19. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
No...but it has 'a way' to notify the controller to come ask for fresh data.
[Object isKindOfClass:[Classname class]]
Strong. Object memory is freed at the end of the routine.
20. What is the name of a property in the controller that it uses to talk to views?
internal origin and size. Use this inside a view
An outlet.
[Object isMemberOfClass:[Classname class]]
Two floats - for width and height
21. What is the fundamental design pattern of iOS development?
Argument validation.
UIWindow
MVC - for model-view-controller
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
22. Where do I initialize properties?
In the getter! This is called lazy instantiation.
The runtime system asks the object what its class is.
Getter and setter methods.
One; zero to many
23. How to tell if an object is of a particular class? (Write a line of code)
line up the colons!
[Object isMemberOfClass:[Classname class]]
NSObject
Don't use id for a pointer. Use the actual type pointed to. It allows the compiler (but not the runtime!) to help find bugs.
24. There is no difference between _____ and _______ at runtime.
NSNumber. For example numberWithDouble: and doubleValue:
Outlet; Action
Lazy instantiation.
id; an object pointer
25. Remember that it's cool to...
self.view
self = [super init] {if init is the designated initializer of the superclass}. If the superclass init routine fails - I will know to return nil from my init routine.
The document; possibly a database.
line up the colons!
26. Why are properties good?
(1) We can validate (e.g. bounds-check) any sets done by a subclass. (2) We can lazily instantiate - so things only get created if and when they are needed.
Cocoa Touch - Media - Core Services - Core OS
Properties; instance variables
At runtime.
27. Classes cannot have _________ or ___________.
No. Use NSMutableArray - which is a subclass of NSArray.
Properties; instance variables
id
The runtime system asks the object what its class is.
28. What is static typing? Why is it good?
29. Dot notation does what?
On left side - is calling the setter - and on the right side - is calling the getter.
@synthesize; write our own getter and/or setter.
NSDictionary; no - it's immutable.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
30. Is it always bad to send messages to id?
31. How to tell whether an object implements a particular method? (A line of code)
[Class respondsToSelector:@selector(aMethod)]
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Nothing happens - and nil is returned.
Action
32. What is the iOS term for a library?
UIViewController.
id; an object pointer
A framework.
Yes. The controller knows everything about the model.
33. ________ is the .h file and __________ is the .m file.
NSData
internal origin and size. Use this inside a view
Instance method; class method.
Interface; Implementation
34. What is the makeup of a CGRect?
Action
A CGPoint and and a CGSize
Nothing happens - and nil is returned.
Instance method; class method.
35. What is the makeup of a CGSize?
Two floats - for width and height
addSubview; removeFromSubview
NSUserDefaults - which stores a property list.
No - it gets the data from the controller.
36. What does 'strong' mean?
37. Is NSString mutable or not?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
NSUserDefaults - which stores a property list.
@synthesize; write our own getter and/or setter.
Center of the frame - which is in the superview's coordinate system
38. The controller is always a subclass of...?
Outlet; Action
The document; possibly a database.
UIWindow
UIViewController.
39. Can the controller talking to the view?
Yes. As much as it wants.
Can handle any language because it uses Unicode.
Cocoa Touch - Media - Core Services - Core OS
internal origin and size. Use this inside a view
40. Talk about NSString
Right-click on view - or even a subview like a button.
Instance variable (ivar) or 'backing variable'
Can handle any language because it uses Unicode.
At runtime.
41. All properties are initialized to _____
Never!
[[UIView alloc] initWithFrame]
Dash - Plus sign.
zero/nil
42. You can send a message to a...
Controls how the model is presented onscreen.
Nothing happens - and nil is returned.
constant NSString
@synthesize; write our own getter and/or setter.
43. Instead of 'include' statements - in Objective-C we use _______ which does ________
Import / handle multiple inclusion.
The document; possibly a database.
Never!
One; zero to many
44. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Strong. Object memory is freed at the end of the routine.
Designated initializer.
self.view
Getter and setter methods.
45. What is in the model?
NSLog; %@; %d and other formatters
Two floats - for width and height
Introspection - with the class method 'class'
The document; possibly a database.
46. How to add subviews in code? How to remove them?
addSubview; removeFromSubview
Import / handle multiple inclusion.
No. It's fine.
No...but it has 'a way' to notify the controller to come ask for fresh data.
47. How about the model talking to the controller?
48. In a nutshell: how to do custom drawing?
Import / handle multiple inclusion.
Wrap it in NSValue. And remember that NSValue immutable.
Override drawRect:
addSubview; removeFromSubview
49. How to see all actions - outlets - incoming/outgoing segues on a view?
Right-click on view - or even a subview like a button.
NSUserDefaults - which stores a property list.
In the getter! This is called lazy instantiation.
'Keep this in the heap until I don't point to anymore.' I won't point to it anymore if I set my pointer to nil - or if I am removed from the heap because no one points strongly to me.
50. What do I use for an unordered collection - e.g. test for membership? And is it mutable?