Wednesday, May 5, 2010

Back to basics

# @interface declaration is identical to a regular function
# @implementation shows a new keyword: super

* Similar to Java, Objective-C only has one parent class.
* Accessing it's super constructor is done through [super init] and this is required for proper inheritance.
* This returns an instance which you assign to another new keyword, self. Self is similar to this in Java and C++.

# if ( self ) is the same as if ( self != nil ) to make sure that the super constructor successfully returned a new object. nil is Objective-C's form of NULL from C/C++. This is gotten from including NSObject.
# After you've initialized the varialbes, you return yourself with return self;
# The deafult constructor is -(id) init;
# Constructors in Objective-C are technically just "init" methods, they aren't a special construct like they are in C++ and Java.
+ is used. The + denotes a class level function.

http://www.otierney.net/objective-c.html#downloading
http://www.atomicobject.com/pages/The+Objective+C+Language



Interface is a class which contain all unimplemented methods( can call them also abstract methods)
We will implement these methods in derived class of interface.
ie an interface is actually not inherited but implemented.
We cann't create an instance of interface object instead we can create an instance for derived class objects

//////////////////

classes in Objective-C provide the basic construct for encapsulating some data with the actions that operate on that data. An object is a runtime instance of a class,

8 comments:

OliveWol8888 said...

良言一句三冬暖,惡語傷人六月寒。..................................................

吳ElwoodR_憲妤 said...

Custom makes all things easy~~加油哦........................................

祐誠 said...

單純喜歡你的部落格 要繼續發表好文章喔........................................

BlakeR_采男 said...

Constant dripping wears away the stone. 滴水穿石!加油!..................................................

子ChristiLavigne11善 said...

影音視訊fm358視訊美女聊天室戀愛ing聊天室視訊網愛免費影片分享視訊聊天交友elove無碼av女優,av成人網,台灣kiss情色貼圖彩虹情人視訊彩虹情人視訊交友網後宮視訊ol制服美女影片視訊交友cleansing78論壇av短片-免費a片情色自拍貼圖片區後宮電影院 色情影片後宮電影院 色情影片視訊聊天室h片影片線上倉井空jp成人免費電影影片網後宮電影網愛 聊天室網愛 聊天室視訊 美女視訊 美女視訊做愛視訊做愛性愛 聊天室性愛 聊天室

黃峻帆 said...

來逛逛blog~~跟您打聲招呼..................................................

walsha said...

人生的價值以及他的快樂,都在於他有能力看重自己的生存 ..................................................

燕延 said...

you always know the right thing to say!............................................................

FEEDJIT Live