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. When is it OK to call drawRect: directly?
Can handle any language because it uses Unicode.
Instance variable (ivar) or 'backing variable'
Never!
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
2. What about public/private in Objective-C?
3. The controller is always a subclass of...?
The compiler adds code to count references.
UIViewController.
A CGPoint and and a CGSize
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
4. What if I want to put a scalar into an NSArray or NSSet?
self
UIWindow
Wrap it in NSValue. And remember that NSValue immutable.
At runtime.
5. How to instantiate an object?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
MVC - for model-view-controller
iOS; when the view is loaded.
No. It's fine.
6. The setters for outlets are called by _______ at this point ______________.
NSData
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
option-click; option-double-click
iOS; when the view is loaded.
7. Classes cannot have _________ or ___________.
Properties; instance variables
Override drawRect:
Strongly.
Cocoa Touch - Media - Core Services - Core OS
8. All classes should have a __________________ to be called by subclasses.
Two CGFloats for x and y
Designated initializer.
id
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.
9. What does the controller do?
NSArray; no - it's immutable.
UIWindow
Controls how the model is presented onscreen.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
10. Can the controller talking to the view?
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Yes. As much as it wants.
Import / handle multiple inclusion.
Cocoa Touch - Media - Core Services - Core OS
11. Remember that it's cool to...
Strongly.
MVC - for model-view-controller
Two CGFloats for x and y
line up the colons!
12. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
No. Use NSMutableArray - which is a subclass of NSArray.
The document; possibly a database.
NSLog; %@; %d and other formatters
Strong. Object memory is freed at the end of the routine.
13. What about controller talking to the model?
Yes. The controller knows everything about the model.
A CGPoint and and a CGSize
Yes. As much as it wants.
constant NSString
14. What does a view (UIView) represent?
A rectangular area
Import / handle multiple inclusion.
The compiler adds code to count references.
To zero; so pointers are nil.
15. If I need to convert a number to an object - use __________
NSNumber. For example numberWithDouble: and doubleValue:
NO is zero; YES is anything else.
internal origin and size. Use this inside a view
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
16. All properties are initialized to _____
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.
Argument validation.
zero/nil
Action
17. What is an example of a reason to write a getter?
NSObject
Other MVC trios.
Lazy instantiation.
Never!
18. What is the makeup of a CGRect?
zero/nil
A CGPoint and and a CGSize
One; zero to many
Two floats - for width and height
19. What is the name of a property in the controller that it uses to talk to views?
Call setNeedsDisplay:
Import / handle multiple inclusion.
Class XX = [Object class]
An outlet.
20. What is the center property of a UIView?
21. Some controllers have ____________ as their views.
No. Use NSMutableArray - which is a subclass of NSArray.
A framework.
Other MVC trios.
Call setNeedsDisplay:
22. Instance methods start with a ______ and class methods start with a ______.
Dash - Plus sign.
Getter and setter methods.
'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.
Two CGFloats for x and y
23. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Lazy instantiation.
Strong. Object memory is freed at the end of the routine.
If it's in the header file - it's public. To make some private variables - you can put a private interface section at the top of an implementation file.
NSArray; no - it's immutable.
24. How to do enumeration with NSArray - NSDictionary - etc?
25. What is the frame property of a UIView?
26. The single-view template in Xcode does not...
'Keep this in the heap as long as someone else points to it strongly. If it gets thrown out of the heap - set my pointer to it to nil.'
Can handle any language because it uses Unicode.
create a model
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.
27. What do I use for an ordered collection of objects? And is it mutable?
28. What is the makeup of a CGPoint?
Yes. As much as it wants.
MVC - for model-view-controller
Wrap it in NSValue. And remember that NSValue immutable.
Two CGFloats for x and y
29. What to do in Xcode for short documentation? For full documentation?
If it's in the header file - it's public. To make some private variables - you can put a private interface section at the top of an implementation file.
option-click; option-double-click
No. It's fine.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
30. Calling a method on id works just fine because....?
Wrap it in NSValue. And remember that NSValue immutable.
Argument validation.
The runtime system asks the object what its class is.
Controls how the model is presented onscreen.
31. Class methods are used for ___________ and the call starts with ____________.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
constant NSString
the controller's minions. Gets things to the screen.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
32. The decision on what method to call is made when?
Wrap it in NSValue. And remember that NSValue immutable.
@synthesize; write our own getter and/or setter.
Two floats - for width and height
At runtime.
33. In the initializer methods of objects I create - add what line of code? Why?
Class XX = [Object class]
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.
NSObject
constant NSString
34. A _______ is how a view notifies the controller of something - for example - a button press.
Action
'Keep this in the heap as long as someone else points to it strongly. If it gets thrown out of the heap - set my pointer to it to nil.'
To zero; so pointers are nil.
[Object isMemberOfClass:[Classname class]]
35. What is at the top of the view hierarchy?
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
To zero; so pointers are nil.
The document; possibly a database.
UIWindow
36. How can I find out the class of any object? Give a line of code.
Introspection - with the class method 'class'
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Class XX = [Object class]
Two CGFloats for x and y
37. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
Getter and setter methods.
NSUserDefaults - which stores a property list.
[Object isKindOfClass:[Classname class]]
NSObject
38. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
The compiler adds code to count references.
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.
Instance method; class method.
39. What is the makeup of a CGSize?
The runtime system asks the object what its class is.
Two floats - for width and height
the controller's minions. Gets things to the screen.
Never!
40. Does a view 'own' the data it displays?
NSDictionary; no - it's immutable.
NSLog; %@; %d and other formatters
No. Use NSMutableArray - which is a subclass of NSArray.
No - it gets the data from the controller.
41. Dot notation does what?
NSNumber. For example numberWithDouble: and doubleValue:
On left side - is calling the setter - and on the right side - is calling the getter.
Strong. Object memory is freed at the end of the routine.
MVC - for model-view-controller
42. Instead of 'include' statements - in Objective-C we use _______ which does ________
for...in; don't change things inside the loop.
line up the colons!
The runtime system asks the object what its class is.
Import / handle multiple inclusion.
43. What do I use for a bag of bits?
option-click; option-double-click
Interface; Implementation
NSData
Introspection - with the class method 'class'
44. There is no difference between _____ and _______ at runtime.
No - it gets the data from the controller.
Argument validation.
id; an object pointer
constant NSString
45. What is static typing? Why is it good?
46. ________ is the .h file and __________ is the .m file.
A framework.
option-click; option-double-click
Interface; Implementation
[Class respondsToSelector:@selector(aMethod)]
47. How to access the controller's top view?
A framework.
Wrap it in NSValue. And remember that NSValue immutable.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
self.view
48. In a nutshell: how to do custom drawing?
Override drawRect:
If it's in the header file - it's public. To make some private variables - you can put a private interface section at the top of an implementation file.
@synthesize; write our own getter and/or setter.
One; zero to many
49. How about the model talking to the controller?
50. Is it always bad to send messages to id?