Monday, 13 August 2012

History & Basic class

 Hi friends Hope are you well........

 Objective-C

 1. HISTORY-


*  1980 S : Objective-C language  designed by  Brand J.Cox and Tom Love at company  Stepstone .
                 
  –Object-oriented extension of C. Inspired by Smalltalk.
  –Strict superset of C.
        After Steve Jobs left Apple Inc. he started the company NeXT. 
*  1988 : NeXT Software licenses the Objective-C language and develops NEXTSTEP .
*  1992 : FSF adds Objective-C to GNU compiler suite .
*  1994 : NeXT Computer and Sun Microsystems release a standardized OPENSTEP specification
*    1996 : Apple acquires NeXT Software. Use for OS X. OPENSTEP now called Cocoa.


  In Xcode Editter Work in MVC architecture so in development conatined a mainly three sections:-

  1. Header files(.h).
  2.Implemenation files(.m).
  3.Programe file(Main method).

  Header file(.h) :-

  Its also called interface section , there define a variables and methods.

  Ex:-

  @Interface DemoClass : NSObject{                                  NSString - NS (NExtstep history reason)
                                                                                          srting declartaion like a pointer
  NSString *name;                                                                NSObject is a super class in fondation 
  int rno;                                                                                framework .(MM, and others)
  }

  -(void) setname:(NSString*)nm;
  -(void)setrno:(int)rn;
  -(void)show;
  @end

  Implementation section (.m):-

  There create a method body logical degine a programe in this section.
  #import "ClassDemo.h"

  @implementation ClssDemo

  -(void) setname:(NSString*)nm{
    name=nm;
  }
  -(void)setrno:(int)rn
  {
  rno=rn;

  }
  -(void)show

  {
  NSLog(@"%@ Name is",name);
  NSLog(@"%d rno is",rno);
  }
  @end

  Main Programe:-

  Object Creation.
  Methods Calling.

  ClassDemo *obj = [[ClassDemo allo]init];
  [obj setname:@"abe"];
  [obj setrno:101];
  [obj show];
  @end

No comments:

Post a Comment