ART40545 - Basics of Programming: iOS

 

Week 11

Instruments Lesson

Heap memory is essentially a large pool of memory (typically per process) from which the running program can request chunks. This is typically called dynamic allocation.

It is different from the Stack, where "automatic variables" are allocated. So, for example, when you define in a C function a pointer variable, enough space to hold a memory address is allocated on the stack. However, you will often need to dynamically allocate space (With malloc) on the heap and then provide the address where this memory chunk starts to the pointer.

 

Protocol Review

Projects analysis

Next Quarter:

in App

iBeacon

Restore State

week 11 materials

Week 10

Best block description (in my opinion)

Social mixer from 5:00pm to 6:00 pm

// NSLog(@"%s SQLITE_ERROR '%s' (%1d)", __FUNCTION__, sqlite3_errmsg(_tripsDB), sqlite3_errcode(_tripsDB));. NSLog( @"Failed from sqlite3_step(statement) Error is: %s",sqlite3_errmsg(_tripsDB));

SQLite Result Codes

Dealing with other Errors: From the source

A bit on Global Breakpoints and objc_exception_throw

Unit Testing with XCTest

From the source

OSX Server and XCODE Integration

Background Fetching (In our continuing theme of accessing external data)

Reflector/Feedback

Project Help

Week 11 (OCMock, Lighter ViewControllers,CocoaPods) Possible Guests

Unice: Week 9 - Get the camera and photo library to work Week 10 - Get the map and SQL data storage to work Week 11 - Fix minor design issues (send me stuff!);

Daniel-  incorporate the sqlite database, the timer and the bingo button into my project  - Need Submission

Jenny- Almost done

Val: Questions about Database. (Have Submission_

Clay:

Silvia: (Have Submission)

Antti:

Sora:

Nathan:

Juan:

Aaron:

 

week 10 materials

Week 9

https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/200-Adopting_a_Continuous_Integration_Workflow/adopt_continuous_integration.html

JSON with AFNetworking

https://github.com/AFNetworking/AFNetworking

Closer Look at MVC

GDC with Dispatch/How to deal with non-responsiveness

Ipad Differences

Couple of similar apps

Unit Testing

Wishes and Daydreams

I agree

Val - Need Timeline/Submission

Nathan design cells project running with preset data in arrays able to pass data between views.

Jenny -timer -database saving logic -loading previous games from database -ui layout, I haven't yet setup appropriate constraints

Daniel-  incorporate the sqlite database, the timer and the bingo button into my project  - Need Submission

Silvia- Make the + add work; make the action sheet work, camera and search in library

Clay- Week 8 – working model minus the sql lite databaseWeek 9 – integrated sql lite database saving data->Need Submission

Antti -- finish score keeping view, player management and course management; DB access already exist => the app can be used keep score for up to 4 random players on any course, but current game is not saved on disk yet

Juan-

  1. Populate the array of BingoSigns objects based on the image files found on the documents directory of my app (I'm stucked right now on this).
  2. Show images on cells in the Collection View
  3. Show detailed info on 2nd view controller (passed through the BingoSigns object)
  4. Allow the user to take a picture from 2nd View Controller to complete/check that cell

Aaron -database framework done  Create all the methods for insert/update/select and have it tested.

Sora Trip Location Map ,Show trip location with city level zoom,Connect Trip Location to Trip Photos View Complete views and function – complete feature and elements

Unice-

week 9 materials

Week 8

Methods & Definitive References

Selector Demos

Blocks

Json Loader

Github

Multi Media Stuff

Social Media

Your Project

Val

Nathan design cells project running with preset data in arrays able to pass data between views.

Jenny -timer -database saving logic -loading previous games from database -ui layout, I haven't yet setup appropriate constraints

Daniel-  incorporate the sqlite database, the timer and the bingo button into my project 

Silvia-

Clay-

Antti -- finish score keeping view, player management and course management; DB access already exist => the app can be used keep score for up to 4 random players on any course, but current game is not saved on disk yet

Juan-

  1. Populate the array of BingoSigns objects based on the image files found on the documents directory of my app (I'm stucked right now on this).
  2. Show images on cells in the Collection View
  3. Show detailed info on 2nd view controller (passed through the BingoSigns object)
  4. Allow the user to take a picture from 2nd View Controller to complete/check that cell

Aaron -database framework done  Create all the methods for insert/update/select and have it tested.

Sora Trip Location Map ,Show trip location with city level zoom,Connect Trip Location to Trip Photos View Complete views and function – complete feature and elements

a. Add Trip –

b. List Trip –

i. Add Location Data into DB

ii. Display/Enable Location field based on Switch Selection

i. Update cell to custom format – show dates and notes

Unice -

Week 7

Job/Internship Hunting

The Stigma behind the terms: "Entry Level" and "Intern"

Example -BAD

Example -GOOD

Homework examples

Delegate Example

Protocol Example

http://www.youtube.com/watch?v=KzsPntlhLxM

Blocks

Apple's Blocks

What about these Blocks

Connecting to an external DB

File Uploader Using MKNetwork

Audio Recorder

Movie Player

Media Playground (for harvesting)

JSON Master.

For homework, I would like to individualize assignments based on your project.

 

week 7 materials

Week 6

A look at your prototypes and code brainstorming

To download legacy emulator:

xcode>preferences>downloads>components

Snippets are in ~Library/Developer/Xcode/UserData

Resizing Image - This is an older post, but makes sense

An improvised method for resampling pics

Properties vs Ivars

Bingo Setup

Back to sql demo

Sqlite Exercise

Sqlite Functions

A look at Core Data

 

week 6 materials

Week 5

From:Antti:

How to handle exceptions

1) goTo the breakpoint tab in Xcode.

2) click on the '+" button at the bottom.

3) Add Exception Breakpoint

a) In the break tab select both:

  i) on Throw     ii) on Catch 

and build and r un.

4) These breakpoints will give you exactly where your app is crashing 90% of the times.

Scope and Self

Homeworks

Sqlite

For terminal practice:

sqlite3 ./mydatabase.db
 SQLite version 3.6.12
 Enter ".help" for instructions
 Enter SQL statements terminated with a ";
" sqlite>

sqlite>  create table contacts (id integer primary key autoincrement, name text, address text, phone text);
sqlite> .tables contacts
sqlite> insert into contacts (name, address, phone) values ("Bill Smith", "123 Main Street, California", "123-555-2323");
sqlite> insert into contacts (name, address, phone) values ("Mike Parks", "10 Upping Street, Idaho", "444-444-1212");
sqlite> select * from contacts; 

sqlite> select * from contacts where name="Mike Parks"; 
sqlite> .exit 

Commands

SQlite Helpers

Camera

Map

Week 4

Homework and passing object references

What goes on in a header file:

Defining the variables in the brackets simply declares them instance variables.

Declaring (and synthesizing) a property generates getters and setters for the instance variable, according to the criteria within the parenthesis. This is particularly important in Objective-C because it is often by way of getters and setters that memory is managed (e.g., when a value is assigned to an ivar, it is by way of the setter that the object assigned is retained and ultimately released). Beyond a memory management strategy, the practice also promotes encapsulation and reduces the amount of trivial code that would otherwise be required.

It is very common to declare an ivar in brackets and then an associated property (as in your example), but that isn't strictly necessary. Defining the property and synthesizing is all that's required, because synthesizing the property implicitly also creates an ivar.

The approach currently suggested by Apple (in templates) is:

-Define property in header file, e.g.:

@property (assign, readonly) gameCenter;

Then synthesize & declare ivar in implementation:

@synthesize gameCenter = __ gameCenter;

The last line synthesizes the gameCenter property and asserts that whatever value is assigned to the property will be stored in the __gameCenter ivar. Again, this isn't necessary, but by defining the ivar next to the synthesizer, you are reducing the locations where you have to type the name of the ivar while still explicitly naming it.

Sqlite versus Core Data

Coding Plan based on sketches

Juan

Val

Plist for storage

NSTimer Class

Camera

Google Maps

Week 3

A more efficient calculator code

Some more Custom Class Scripts

Data Source & Delagate Scripts

Datasources and Delegates: For now, delegates are used to extend the functionality of a class without resorting to subclassing. They provide a design pattern that maintains very loose coupling between classes, usually more generic ones like views, and those with application specific functionality. Some of the most common examples of classes that use delegates are windows (in Cocoa), tableViews, and textFields/textViews. A tableView, for example, only knows how to draw itself, and while it could be sub-classed to deal with the presentation and manipulation of the data it displays, that is counter to MVC paradigm. Delegate methods are of the 
-will
-should
-did
type. They allow the application to set up constraints, pre and post processing and reactions to events. A simple scenario- Text is entered in a textField and the window containing the textField is about to close. What should be done with the input text? The window and textFields are simply containers, they don't and shouldn't know how to handle it, so their delegate is informed about what is about to occur (-windowShouldClose and -textFieldShouldResignFirstResponder for example) and it is the delegate's responsibility to allow or prevent this from taking place, or take some action before allowing it to occur.

Styling a table cell

Adding plists to our simple table from last week

collection views: grids, stacks, tiles and circular arrangements.

collection view consists of four key elements consisting of cells, supplementary views, decoration views and a layout object.

UICollectionView  & UICollectionView Layout & UICollectionViewCell Classes

PROJECT COMMITMENTS :

Sora - Trip Journal

Nathan - Trip Journal

Clay - TBD

Daniel - TBD

Antii -Golf

Val - TBD

Jenny - Road Sign Game

Aaron - Trip Journal

Tom - Road Sign Game

Silvia - TBD

Juan - Road Sign Game

Unice - Trip Journal

Next week plists

week 3 materials

Week 2

How to Sort a Dictionary object


    NSString *last = @"lastName";
    NSString *first = @"firstName";
    
    
    
    NSMutableArray *array = [NSMutableArray array];
    NSArray *sortedArray;
    
    NSDictionary *dict;
    dict = [NSDictionary dictionaryWithObjectsAndKeys:
            @"Jo", first, @"Smith", last, nil];
    [array addObject:dict];
    
    dict = [NSDictionary dictionaryWithObjectsAndKeys:
            @"Joe", first, @"Smith", last, nil];
    [array addObject:dict];
    
    dict = [NSDictionary dictionaryWithObjectsAndKeys:
            @"Joe", first, @"Smythe", last, nil];
    [array addObject:dict];
    
    dict = [NSDictionary dictionaryWithObjectsAndKeys:
            @"Joanne", first, @"Smith", last, nil];
    [array addObject:dict];
    
    dict = [NSDictionary dictionaryWithObjectsAndKeys:
            @"Robert", first, @"Jones", last, nil];
    [array addObject:dict];
    
    //Next we sort the contents of the array by last name then first name
    
    // The results are likely to be shown to a user
    // Note the use of the localizedCaseInsensitiveCompare: selector
    NSSortDescriptor *lastDescriptor =
    [[NSSortDescriptor alloc] initWithKey:last
                                ascending:YES
                                 selector:@selector(localizedCaseInsensitiveCompare:)];
    NSSortDescriptor *firstDescriptor =
    [[NSSortDescriptor alloc] initWithKey:first
                                ascending:YES
                                 selector:@selector(localizedCaseInsensitiveCompare:)];
    
    NSArray *descriptors = [NSArray arrayWithObjects:lastDescriptor, firstDescriptor, nil];
    sortedArray = [array sortedArrayUsingDescriptors:descriptors];


    NSLog(@"This is my NSArray: %@", [sortedArray description]);

http://stackoverflow.com/questions/19599266/invalid-context-0x0-under-ios-7-0-and-system-degradation

Discussion on projects

Catching up with the files from last week

Conditions, Functions, Enumerations and Arrays (Some basic Obj-C things )

More UI Controls and how to use 'em

Move forward with calculator assignment/Keyboard Control numeric/resign first responder/delegates

Switching Views/Storyboards

Begin Calculator App

Discuss project ideas-what type of navigation? What type of interface? What Frameworks might we need?

week 2 materials

 

Week 1

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    
    UITouch *touch = [[event allTouches] anyObject];
    if ([_tempInput isFirstResponder] && [touch view] != _tempInput) {
        [_tempInput resignFirstResponder];
    }
    [super touchesBegan:touches withEvent:event];
}


							

xcode tour

Book: There is a discount code of DSUG for all O'Reilly Books

http://shop.oreilly.com/product/0636920031017.do and

http://shop.oreilly.com/product/0636920032465.do

IOS Screen sizes

- Introduction to the tools, toud

-Objective C and Objective C as it relates to IOS,Variables,Datatypes,Operators,Strings,Placeholders,Conditions,Loops,

- Objective C continued. Code Snippets, Functions

-Xcode/Creating a Basic Interaction

-Temperature Converter