Upload
hock-leng-puah
View
1.088
Download
4
Embed Size (px)
DESCRIPTION
Take another look at Objective Primer with reference to C#
Citation preview
C# => Objective C primer
Nov 2011
Demonstrate example for using header file: method definition
Object type
Demonstrate example for using adhoc object
Method & Messaging
C# void InsertObject(object anObject, int index)
Method & Messaging
Objective-C vs C# + static (class method)- (normal public instance method)
Calling a method
C# myArray.InsertObject(anObject, 0);
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
Use accessor methods (Properties) using dot
PropertiesDeclare – in .h file
Define – in .m file
Pointer: *
NSxxx, CGxxxx
NextStep CoreGraphics
cocos2D objects and methods
Actions