Lecture 03

Lecture 03 - CS193p Spring 2010 Thursday, April 29, 2010...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS193p Spring 2010 Thursday, April 29, 2010 Announcements You should have received an e-mail by now If you received e-mail approving enrollment, but are not in Axess, do it! If you have any questions, please ask via e-mail or after class. If you have not installed SDK and gotten it working, talk to us after class. Homework Strongly recommend trying a submission today even if youre not yet done Multiple attempted submissions is no problem Assignments are to be done individually (except approved pairs for Fnal project) Honor code applies Any questions about the homework? Thursday, April 29, 2010 Communication E-mail Questions are best sent to cs193p@cs.stanford.edu Sending directly to instructor or TAs risks slow response. Web Site Very Important! http://cs193p.stanford.edu All lectures, assignments, code, etc. will be there. This site will be your best friend when it comes to getting info. Thursday, April 29, 2010 Todays Topics Objective-C Instance Variables Methods (Class and Instance) Properties Dynamic vs. Static Binding Introspection Protocols and Delegates Foundation Framework NSObject, NSString, NSMutableString NSNumber, NSValue, NSData, NSDate NSArray, NSDictionary, NSSet NSUserDefaults, etc. Memory Management Allocating and initializing objects Reference Counting Thursday, April 29, 2010 Instance Variables By default, they are protected Only methods in the class itself and subclasses can see them Can be marked private with @private Can be marked public with @public Dont do it! Use properties instead. Later. @interface Ship : Vehicle { Size size; @private int turrets; @public NSString *dontDoThisString; } Thursday, April 29, 2010 Methods If public, declare them in .h Fle. Public or private, implement them in .m Fle. or instance method with - 2. Then return type in parentheses (can be void if returns nothing) 3. Then Frst part of name of method, always ending in : unless zero args 4. Then type of Frst argument in parentheses 5. Then name of Frst argument 6. If more arguments, next comes a required space, then repeat 3-5 7. Then semicolon if declaring Spaces allowed between any of the above steps, but no spaces in step 3 or 5- (NSArray *)findShipsAtPoint:(CGPoint)bombDrop withDamage:(BOOL)damaged 1. Specify class method with + (more on this later) , or code inside { } if implementing ; Methods If public, declare them in .h Fle....
View Full Document

This note was uploaded on 02/15/2011 for the course CS 193P taught by Professor Evandoll during the Spring '09 term at Stanford.

Page1 / 20

Lecture 03 - CS193p Spring 2010 Thursday, April 29, 2010...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online