Tuesday, 14 April 2015

April 12

App Plan
I would like to be able to be able to
1. have a canvas with infinite scroll and pinch to zoom
2. be able to add polygons
3. there will be no coordinate system.
the polygons will be constructed in the following way

There are 8 actions
1. Add poly
3. select poly (select poly changes the color)
3a. add vert at head
3b. del vert at head
3c Hausdorff = select another. simple animation ending with a line drawn between the pair of points determined by Hauss. This line disappears if
3d min hausdorff = select another
3e delete
7. exit mode
(add and delete are hard

other
1. don't care about snap to point
2. don't care about recognizing boxs, rects, etc

Good fundamentals for IOS dev
1. read documentation before asking online
2. watch WWDC videos

Bugs
Tried to create a new class and got the error
"redefinition as a different kind of symbol"
But I changed rect to rectangle and the bug was resolved. I guess there is something in the Foundation namespace.

#
Outstanding issues
I still have not figured out how to do refactoring in Xcode..

#
Started at 9:00
In an hour and 45 mins was only able to implement a single super class...

# 2pm
again
UITableViewDelegate
UITableViewDataSource

NumberOfRowsInSectionc
cellForRowAtIndexPath
these are methods which are part of the UITableViewDataSource protocol
this means that it is mandatory to implement these methods as part of the protocol.

An ObjC thing in the namespace is distinguished by the names of each of its inputs.
So for example we could call a method that takes two inputs X and Y
"X:Y"

#
In java the class file name is forced to be the same as the file name
But this is not required in C...

#
Bug

Was reading the text too quickly. Need to read each line slowly to grasp its meaning.

#
# notes on the text
#
Constraints are visible in Document Outline
There are 4 kinds of constraints

There are a couple of things we need to do
1. we need to switch from UITableViewController over UITableView
So its important to understand that UITableView will work for table display. We just need to implement that protocol
Whenever I'm given a list of protocols in the form <A,B,C,D> to implement it would be good to compare A,B,C,D to see if there are some common words that start the method names.
Unlike Java which would have some define some class for each protocol, in objective C we just use prefixes to designate a particular class.

Chapter 4
Another new project. Single view application.
We call it CustomTable.
We disable size classes by going into the File Inspector
We are going to create a Cocoa Touch Class called CustomTableViewController

#
viewDidLoad method
add some stuff
we are needing to implement two datasource methods

tableView:numberOfRowsInSection
tableView:cellForRowAtIndexPath
there are default implementations. However, they don't usually work good.

In one of them we are going to pass in the number of sections. However, the number of sections here is one.
April 13
method that returns set of students

Defining them
Start by defining the protocol
using @protocol

Objective C only has single inheritance. Inheritance from a single class.
@protocol TaskDelegate <NSObject>

#
Limits of tools
Is UITableView not able to display a distinct image for each entry in the table view.

To build a custom cell simply use
UILabel, UIImageView
are UIControls that can be added to the prototype cell.

To perform these customizations we need to change the cell style from Basic to Custom.

2 changes are needed to make the images larger.
1. change row height of the cell
2.

#
Reading
"Programming Views in IOS"
Each parent is responsible for positioning its children.

#
What is the difference between an action and an outlet ?

#
ViewController are informed about view status using outlets.
Views are updated by actions.

I have a TextView for entering celcius temp. I need this view to communicate with the viewcontroller class. So I would think I need to use action.

"Interface type" cannot be statically allocated.

Questions
What does static allocation mean in ObjectiveC ?

#
Useful commands
initWithFormat

Remember
Keyboard does not vanish after the user has entered some text. The solution is to create a method that takes a sender of type id as input and returns an IBAction.
Did end on exit