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. Objects in an array: are the pointed to strongly or weakly?
Never!
Strongly.
Instance variable (ivar) or 'backing variable'
Class XX = [Object class]
2. Is NSString mutable or not?
No...but it has 'a way' to notify the controller to come ask for fresh data.
id; an object pointer
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
'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.
3. You can send a message to a...
constant NSString
Instance variable (ivar) or 'backing variable'
'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.
UIViewController.
4. How are local variables initialized in iOS 5?
No. It's fine.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Can handle any language because it uses Unicode.
To zero; so pointers are nil.
5. Does a view 'own' the data it displays?
NSDictionary; no - it's immutable.
The runtime system asks the object what its class is.
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.
No - it gets the data from the controller.
6. What is the makeup of a CGRect?
A CGPoint and and a CGSize
NO is zero; YES is anything else.
Nothing happens - and nil is returned.
An outlet.
7. How to access the controller's top view?
self.view
zero/nil
[Object isKindOfClass:[Classname class]]
iOS; when the view is loaded.
8. What is an example of a reason to write a getter?
Lazy instantiation.
An outlet.
Never!
A CGPoint and and a CGSize
9. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
line up the colons!
MVC - for model-view-controller
[Object isMemberOfClass:[Classname class]]
[Object isKindOfClass:[Classname class]]
10. Is NSArray mutable?
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
A framework.
No. Use NSMutableArray - which is a subclass of NSArray.
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.
11. What is the frame property of a UIView?
12. All classes should have a __________________ to be called by subclasses.
Designated initializer.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
zero/nil
The runtime system asks the object what its class is.
13. What if I want to put a scalar into an NSArray or NSSet?
create a model
'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.
Wrap it in NSValue. And remember that NSValue immutable.
Two CGFloats for x and y
14. What does a view (UIView) represent?
Interface; Implementation
id; an object pointer
A rectangular area
NSObject
15. Show a private interface section.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
for...in; don't change things inside the loop.
id
Yes. The controller knows everything about the model.
16. What is in the model?
Nothing happens - and nil is returned.
[Class respondsToSelector:@selector(aMethod)]
iOS; when the view is loaded.
The document; possibly a database.
17. 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.
UIViewController.
internal origin and size. Use this inside a view
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
18. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
Dash - Plus sign.
My rectangle in my superview's coordinate space
NSLog; %@; %d and other formatters
The runtime system asks the object what its class is.
19. What does the controller do?
Center of the frame - which is in the superview's coordinate system
Interface; Implementation
Controls how the model is presented onscreen.
One; zero to many
20. How to force a redraw of a custom area?
Call setNeedsDisplay:
option-click; option-double-click
One; zero to many
The compiler adds code to count references.
21. A _______ is how a view notifies the controller of something - for example - a button press.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Action
self
NSArray; no - it's immutable.
22. What does 'strong' mean?
23. There is no difference between _____ and _______ at runtime.
My rectangle in my superview's coordinate space
id; an object pointer
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Designated initializer.
24. How to tell whether an object implements a particular method? (A line of code)
Strong. Object memory is freed at the end of the routine.
NSNumber. For example numberWithDouble: and doubleValue:
At runtime.
[Class respondsToSelector:@selector(aMethod)]
25. Are local pointers to objects strong or weak? So what happens at the end of the routine?
My rectangle in my superview's coordinate space
Strong. Object memory is freed at the end of the routine.
Never!
UIWindow
26. Is it always bad to send messages to id?
27. How to create a UIView in code?
constant NSString
No. It's fine.
[[UIView alloc] initWithFrame]
(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.
28. What do I use for a hash table/associative array? And is it mutable?
29. The view is...
30. What to do in Xcode for short documentation? For full documentation?
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
NSLog; %@; %d and other formatters
Action
option-click; option-double-click
31. What do I use for an ordered collection of objects? And is it mutable?
32. ______ is a pointer
Two CGFloats for x and y
option-click; option-double-click
self
'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.'
33. Talk about BOOL variables.
NO is zero; YES is anything else.
UIWindow
[Class respondsToSelector:@selector(aMethod)]
option-click; option-double-click
34. ________ is the .h file and __________ is the .m file.
Yes. As much as it wants.
Cocoa Touch - Media - Core Services - Core OS
In the getter! This is called lazy instantiation.
Interface; Implementation
35. The basic steps in custom drawing.
In the getter! This is called lazy instantiation.
Two CGFloats for x and y
NSDictionary; no - it's immutable.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
36. The single-view template in Xcode does not...
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.
create a model
In the getter! This is called lazy instantiation.
Instance method; class method.
37. The setters for outlets are called by _______ at this point ______________.
Introspection - with the class method 'class'
The compiler adds code to count references.
iOS; when the view is loaded.
@synthesize; write our own getter and/or setter.
38. What about the model and the view talking to one another?
One; zero to many
NSSet; no - it's immutable
Never!
Cocoa Touch - Media - Core Services - Core OS
39. Instead of 'include' statements - in Objective-C we use _______ which does ________
Import / handle multiple inclusion.
Cocoa Touch - Media - Core Services - Core OS
Introspection - with the class method 'class'
create a model
40. What is a property list?
id
Controls how the model is presented onscreen.
Introspection - with the class method 'class'
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
41. The decision on what method to call is made when?
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.
A framework.
Properties; instance variables
At runtime.
42. How to add subviews in code? How to remove them?
An outlet.
Import / handle multiple inclusion.
A rectangular area
addSubview; removeFromSubview
43. What about the view talking to the controller?
44. Some controllers have ____________ as their views.
NSDictionary; no - it's immutable.
Other MVC trios.
Override drawRect:
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
45. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
46. How to see all actions - outlets - incoming/outgoing segues on a view?
Yes. As much as it wants.
internal origin and size. Use this inside a view
Strongly.
Right-click on view - or even a subview like a button.
47. Calling a method on id works just fine because....?
The runtime system asks the object what its class is.
Yes. As much as it wants.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
A framework.
48. What is the name of a property in the controller that it uses to talk to views?
An outlet.
At runtime.
Cocoa Touch - Media - Core Services - Core OS
(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.
49. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
50. What is the makeup of a CGSize?
Never!
My rectangle in my superview's coordinate space
Two floats - for width and height
(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.