diff options
author | Adam <adam@adambard.com> | 2013-09-04 09:33:38 -0700 |
---|---|---|
committer | Adam <adam@adambard.com> | 2013-09-04 09:33:38 -0700 |
commit | 20c866041845a8cc438fce4a0cceb18cb940774d (patch) | |
tree | 576e35218a004db2ced0cd9a6423385e8e3e6204 /objective-c.html.markdown | |
parent | e546f9cd9c87733fc9e502746109a8abe0a12f86 (diff) | |
parent | 95e9194077083243a88f86106a97a06cc715ccdf (diff) |
Merge branch 'master' of https://github.com/adambard/learnxinyminutes-docs
Diffstat (limited to 'objective-c.html.markdown')
-rw-r--r-- | objective-c.html.markdown | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/objective-c.html.markdown b/objective-c.html.markdown index 9e9f43e7..926a4a0d 100644 --- a/objective-c.html.markdown +++ b/objective-c.html.markdown @@ -160,7 +160,7 @@ int main (int argc, const char * argv[]) int jj; for (jj=0; jj < 4; jj++) { - NSLog(@"%d,", jj++); + NSLog(@"%d,", jj); } // => prints "0," // "1," // "2," @@ -223,7 +223,7 @@ int main (int argc, const char * argv[]) // } // -/+ (type) Method declarations; // @end -@interface MyClass : NSObject <MyCustomProtocol> +@interface MyClass : NSObject <MyProtocol> { int count; id data; @@ -241,14 +241,14 @@ int main (int argc, const char * argv[]) + (NSString *)classMethod; // - for instance method -- (NSString *)instanceMethodWithParmeter:(NSString *)string; +- (NSString *)instanceMethodWithParameter:(NSString *)string; - (NSNumber *)methodAParameterAsString:(NSString*)string andAParameterAsNumber:(NSNumber *)number; @end // Implement the methods in an implementation (MyClass.m) file: -@implementation UserObject +@implementation MyClass // Call when the object is releasing - (void)dealloc @@ -271,7 +271,7 @@ int main (int argc, const char * argv[]) return [[self alloc] init]; } -- (NSString *)instanceMethodWithParmeter:(NSString *)string +- (NSString *)instanceMethodWithParameter:(NSString *)string { return @"New string"; } |