Day-7 Flashcards

1
Q

UIDatePicker

A

implements an object that uses multiple rotating wheels to allow users to select dates and times

Can also be used as a countdown timer

Has an intrinsic width of 320, you can squeeze it down to 240 and still see everything

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

UIPickerView

A

numberOfComponentsInPickerView: pickerView:numberOfRowsInComponent: pickerView:titleForRow:ForComponent:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

NSDate & NSDateFormatter

A

NSDate - a representation of a single point in time
NSCalendar - a representation of a particular calendar type (Buddhist, Chinese, Hebrew, etc)
NSDateComponents - a representation of particular parts of a date, like an hour, minute, day, year, etc

NSDate represents a single point in time
Immutable once created
The standard unit of time for date objects is floating point value typed as NSTimeInterval expressed in seconds

Use one of NSDate’s initWithTimeInterval init methods for specific dates creation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Calendars

A

You use calendar objects to convert between times and date components (years, days, minutes, etc)

Use methods setDay:, setMonth:, setYear:, etc to set those individual components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

NSDateFormatter My Favorite <3

A

You can set the NSDateFormatter’s style to set the desired style of date: NoStyle, ShortStyle, MediumStyle, LongStyle, FullStyle

Supports custom date formatting / style with setDateFormat: method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

NSPredicate

A

Query language describing how data should be fetched and filtered

Describes logic conditions to use when searching collections

Use predicateWithFormat for building simple predicates

  • You can use %@ to substitute for an object value (usually a string)
  • You can use %K to substitute for an attribute or attributes (via key path)

NOTE: Most collection classes (except NSDictionary, NSIndexSet) can be searched and filtered using NSPredicate

Comparison Operations:-

=, == 
>=, =>
!=, <> - the left hand expression is not equal to the right hand expression
BETWEEN
BEGINS WITH
CONTAINS
ENDS WITH
LIKE
MATCHES
ANY, SOME 
ALL
NONE
IN
AND, &amp;&amp;
OR, || 

self refers to each entity we are querying against

NSManagedObjectResultType - returns managed objects
NSCountResultType - returns the count of all the objects that match the fetch
NSDictionaryResultType - returns the results back in a dictionary
NSManagedObjectIDResultType - returns the object id(s) instead of full-fledged managed objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly