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. What is the bounds property of a UIView?
NSDictionary; no - it's immutable.
[Object isKindOfClass:[Classname class]]
internal origin and size. Use this inside a view
Strong. Object memory is freed at the end of the routine.
2. How to access the controller's top view?
self.view
[Class respondsToSelector:@selector(aMethod)]
Never!
Nothing happens - and nil is returned.
3. Where do I initialize properties?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Call setNeedsDisplay:
Designated initializer.
In the getter! This is called lazy instantiation.
4. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
NSSet; no - it's immutable
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Instance method; class method.
UIWindow
5. What about public/private in Objective-C?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
6. How to create a UIView in code?
UIWindow
Other MVC trios.
[[UIView alloc] initWithFrame]
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
7. A _______ is how a view notifies the controller of something - for example - a button press.
Action
Instance variable (ivar) or 'backing variable'
Yes. As much as it wants.
zero/nil
8. Talk about BOOL variables.
NO is zero; YES is anything else.
No. Use NSMutableArray - which is a subclass of NSArray.
To zero; so pointers are nil.
An outlet.
9. Show a private interface section.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Right-click on view - or even a subview like a button.
Can handle any language because it uses Unicode.
create a model
10. What do I use for an ordered collection of objects? And is it mutable?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
11. What does a view (UIView) represent?
NO is zero; YES is anything else.
A rectangular area
Controls how the model is presented onscreen.
Never!
12. Classes cannot have _________ or ___________.
[Object isMemberOfClass:[Classname class]]
Properties; instance variables
Wrap it in NSValue. And remember that NSValue immutable.
No. Use NSMutableArray - which is a subclass of NSArray.
13. What is a reason to write our own setter?
Argument validation.
In the getter! This is called lazy instantiation.
Outlet; Action
NO is zero; YES is anything else.
14. In the initializer methods of objects I create - add what line of code? Why?
Override drawRect:
The compiler adds code to count references.
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.
Class XX = [Object class]
15. Talk about NSString
addSubview; removeFromSubview
[Class respondsToSelector:@selector(aMethod)]
Can handle any language because it uses Unicode.
MVC - for model-view-controller
16. ______ is a pointer
No - it gets the data from the controller.
self
NO is zero; YES is anything else.
Other MVC trios.
17. How are local variables initialized in iOS 5?
Other MVC trios.
No. It's fine.
To zero; so pointers are nil.
'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.'
18. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
19. What is the fundamental design pattern of iOS development?
the controller's minions. Gets things to the screen.
self
The compiler adds code to count references.
MVC - for model-view-controller
20. Is NSArray mutable?
'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.'
Cocoa Touch - Media - Core Services - Core OS
No. Use NSMutableArray - which is a subclass of NSArray.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
21. How to force a redraw of a custom area?
Override drawRect:
A framework.
Two floats - for width and height
Call setNeedsDisplay:
22. ________ is the .h file and __________ is the .m file.
Interface; Implementation
[Object isMemberOfClass:[Classname class]]
Designated initializer.
[Class respondsToSelector:@selector(aMethod)]
23. What about controller talking to the model?
Yes. The controller knows everything about the model.
NSUserDefaults - which stores a property list.
NSData
Can handle any language because it uses Unicode.
24. Remember that it's cool to...
No - it gets the data from the controller.
NSUserDefaults - which stores a property list.
line up the colons!
A CGPoint and and a CGSize
25. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
26. All classes should have a __________________ to be called by subclasses.
An outlet.
Wrap it in NSValue. And remember that NSValue immutable.
Designated initializer.
addSubview; removeFromSubview
27. Instance methods start with a ______ and class methods start with a ______.
Designated initializer.
create a model
Dash - Plus sign.
Outlet; Action
28. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
self.view
[Object isKindOfClass:[Classname class]]
id; an object pointer
Import / handle multiple inclusion.
29. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
30. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
NSLog; %@; %d and other formatters
UIWindow
Outlet; Action
[Class respondsToSelector:@selector(aMethod)]
31. What is the makeup of a CGPoint?
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Two CGFloats for x and y
[Object isKindOfClass:[Classname class]]
NSDictionary; no - it's immutable.
32. What is the makeup of a CGRect?
A CGPoint and and a CGSize
The runtime system asks the object what its class is.
Outlet; Action
Properties; instance variables
33. What is used in lieu of pixels? And why?
Action
Never!
Points - to achieve device-independence
NSLog; %@; %d and other formatters
34. How to tell if an object is of a particular class? (Write a line of code)
NSNumber. For example numberWithDouble: and doubleValue:
Import / handle multiple inclusion.
Other MVC trios.
[Object isMemberOfClass:[Classname class]]
35. What is the base class for most objects in the iOS SDK?
(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.
NSObject
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.
36. Does a view 'own' the data it displays?
id; an object pointer
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
No - it gets the data from the controller.
Dash - Plus sign.
37. ______ is a pointer to any object.
Outlet; Action
id
Instance method; class method.
A rectangular area
38. Some controllers have ____________ as their views.
'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.
Other MVC trios.
internal origin and size. Use this inside a view
option-click; option-double-click
39. What is the center property of a UIView?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
40. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
41. What do I use for a hash table/associative array? And is it mutable?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
42. Can the controller talking to the view?
Yes. As much as it wants.
Controls how the model is presented onscreen.
Right-click on view - or even a subview like a button.
id; an object pointer
43. How is ARC done?
the controller's minions. Gets things to the screen.
Other MVC trios.
iOS; when the view is loaded.
The compiler adds code to count references.
44. Instead of 'include' statements - in Objective-C we use _______ which does ________
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
line up the colons!
Center of the frame - which is in the superview's coordinate system
Import / handle multiple inclusion.
45. The controller is always a subclass of...?
Cocoa Touch - Media - Core Services - Core OS
UIViewController.
id; an object pointer
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
46. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
NSLog; %@; %d and other formatters
No...but it has 'a way' to notify the controller to come ask for fresh data.
Two CGFloats for x and y
(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.
47. What to do in Xcode for short documentation? For full documentation?
Override drawRect:
id; an object pointer
Right-click on view - or even a subview like a button.
option-click; option-double-click
48. How to do enumeration with NSArray - NSDictionary - etc?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
49. When is it OK to call drawRect: directly?
Never!
addSubview; removeFromSubview
The compiler adds code to count references.
[Object isKindOfClass:[Classname class]]
50. Are local pointers to objects strong or weak? So what happens at the end of the routine?
NSLog; %@; %d and other formatters
Strong. Object memory is freed at the end of the routine.
[Class respondsToSelector:@selector(aMethod)]
Outlet; Action