Objective-C 100604
                   Objective-C




2010   6   11
•

                •[                  ]

                • [string length]

2010   6   11
•

                •[                             :   ]

                • [string characterAtIndex: 0]

2010   6   11
•
                •   [                         :

                •          :         ]



                •   [string r...
•   -(             )           :   (        1   )   1

                •          :   (       2   )           2;



      ...
•   -(   )

                •   +(   )



                •
                •   + (id)stringWithString: (NSString*)string
...
•   @interface       :


                •   {

                    •                ;


                •   }




       ...
•   @interface Person : NSObject

                •   {

                    •   int age:

                    •   NSStrin...
• @implementation
                •
                • @end


2010   6   11
• @implementation Person
                • -(BOOL)isAdult
                •{
                 • ...
                •}
   ...
• @property (                   )
                                         ;



                • @property (retain) NSStr...
•   for (                                in   ){

                    •   ...

                •   }



                • ...
Upcoming SlideShare
Loading in …5
×

Objective-C Basic

1,886 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,886
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
30
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Objective-C Basic

  1. 1. Objective-C 100604 Objective-C 2010 6 11
  2. 2. • •[ ] • [string length] 2010 6 11
  3. 3. • •[ : ] • [string characterAtIndex: 0] 2010 6 11
  4. 4. • • [ : • : ] • [string rangeOfString: @”Objective-C” • options: NSCaseInsenstiveSearch] 2010 6 11
  5. 5. • -( ) : ( 1 ) 1 • : ( 2 ) 2; • -(NSRange)rangeOfString: (NSString*) string • options: (NSStringCompareOptions) mask; 2010 6 11
  6. 6. • -( ) • +( ) • • + (id)stringWithString: (NSString*)string 2010 6 11
  7. 7. • @interface : • { • ; • } • - ; • @end 2010 6 11
  8. 8. • @interface Person : NSObject • { • int age: • NSString* firstName; • NSString* lastName; • } • -(BOOL)isAdult; • @end 2010 6 11
  9. 9. • @implementation • • @end 2010 6 11
  10. 10. • @implementation Person • -(BOOL)isAdult •{ • ... •} • @end 2010 6 11
  11. 11. • @property ( ) ; • @property (retain) NSString* firstName; 2010 6 11
  12. 12. • for ( in ){ • ... • } • for (NSString* friend in friends){ • ... • } 2010 6 11

×