16
C# => Objective C primer Nov 2011

Objective C Primer (with ref to C#)

Embed Size (px)

DESCRIPTION

Take another look at Objective Primer with reference to C#

Citation preview

Page 1: Objective C  Primer (with ref to C#)

C# => Objective C primer

Nov 2011

Page 2: Objective C  Primer (with ref to C#)

Demonstrate example for using header file: method definition

Page 3: Objective C  Primer (with ref to C#)
Page 4: Objective C  Primer (with ref to C#)

Object type

Demonstrate example for using adhoc object

Page 5: Objective C  Primer (with ref to C#)

Method & Messaging

C# void InsertObject(object anObject, int index)

Page 6: Objective C  Primer (with ref to C#)

Method & Messaging

Objective-C vs C# + static (class method)- (normal public instance method)

Page 7: Objective C  Primer (with ref to C#)

Calling a method

C# myArray.InsertObject(anObject, 0);

Page 8: Objective C  Primer (with ref to C#)

Nested messagesTo avoid declaring numerous local variables to store temporary results, Objective-C lets you nest messages.

C#myAppObject.theArray()

return A

C#myAppObject.objectToInsert()

return B

[A insertObject:B atIndex:0]

object method parameter parameter

Page 9: Objective C  Primer (with ref to C#)

Use accessor methods (Properties) using dot

Page 10: Objective C  Primer (with ref to C#)

PropertiesDeclare – in .h file

Define – in .m file

Page 11: Objective C  Primer (with ref to C#)

Pointer: *

Page 12: Objective C  Primer (with ref to C#)

NSxxx, CGxxxx

NextStep CoreGraphics

Page 13: Objective C  Primer (with ref to C#)

cocos2D objects and methods

Page 14: Objective C  Primer (with ref to C#)

Actions

Page 15: Objective C  Primer (with ref to C#)
Page 16: Objective C  Primer (with ref to C#)