Intro to
Objective-C
       Andria Jensen
 Co-Owner of Appsolute Genius

http://www.appsolutegenius.com
  andria@appsolute...
Basics
•superset of the C language
•define separate header & source files
•use #import to include headers
Classes
Typing
•Strong vs Weak Type
•the “id” keyword
•object references are *pointers
•value types are not pointers
Methods
Bracket Syntax
•bracket syntax == [self doSomething]
•dot syntax == self.myProperty
•self.myProperty==[self myProperty]
Method calls



You can also use dot syntax for assignment:

This is the same as writing: [myAppObject setTheArray:aNewArr...
Implementation
Properties




You will mostly see properties declared as @property (nonatomic, retain)
Properties
@property(nonatomic, retain) NSString *text; translates as
"I have a member variable of type NSString* named 't...
NSString
•uses same placeholders as C
•@ in front of literal strings
•convenience methods
Questions?
• Contact me
• andria@appsolutegenius.com
• @andriajensen
• @appsolutegenius
• The presentation:
Upcoming SlideShare
Loading in …5
×

iPhone Camp Birmingham - Intro To Objective C

1,395 views

Published on

Introduction to the basics of Objective-C. Created for iPhone Camp Birmingham by Andria Jensen.

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,395
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
27
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • iPhone Camp Birmingham - Intro To Objective C

    1. 1. Intro to Objective-C Andria Jensen Co-Owner of Appsolute Genius http://www.appsolutegenius.com andria@appsolutegenius.com @andriajensen @appsolutegenius
    2. 2. Basics •superset of the C language •define separate header & source files •use #import to include headers
    3. 3. Classes
    4. 4. Typing •Strong vs Weak Type •the “id” keyword •object references are *pointers •value types are not pointers
    5. 5. Methods
    6. 6. Bracket Syntax •bracket syntax == [self doSomething] •dot syntax == self.myProperty •self.myProperty==[self myProperty]
    7. 7. Method calls You can also use dot syntax for assignment: This is the same as writing: [myAppObject setTheArray:aNewArray];
    8. 8. Implementation
    9. 9. Properties You will mostly see properties declared as @property (nonatomic, retain)
    10. 10. Properties @property(nonatomic, retain) NSString *text; translates as "I have a member variable of type NSString* named 'text'. I will want a getter/setter pair that uses the retain/release procedure." @property(nonatomic, assign) int value; translates as "I have a member variable of type int named 'value'. I will want a getter/setter pair that doesn't use the retain/release procedure - just assign it." @synthesize text; translates as "Please automatically create the code for the getter and setter for 'text'" @synthesize value; translates as "Please automatically create the code for the getter and setter for 'value'"
    11. 11. NSString •uses same placeholders as C •@ in front of literal strings •convenience methods
    12. 12. Questions? • Contact me • andria@appsolutegenius.com • @andriajensen • @appsolutegenius • The presentation:

    ×