diff options
-rw-r--r-- | go.html.markdown | 6 | ||||
-rw-r--r-- | objective-c.html.markdown | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/go.html.markdown b/go.html.markdown index 4db76a49..eca5dae0 100644 --- a/go.html.markdown +++ b/go.html.markdown @@ -1,4 +1,4 @@ ---- +--- name: Go category: language language: Go @@ -71,7 +71,7 @@ func learnTypes() { can include line breaks.` // same string type // non-ASCII literal. Go source is UTF-8. - g := 'Σ' // rune type, an alias for uint32, holds a UTF-8 code point + g := 'Σ' // rune type, an alias for uint32, holds a unicode code point f := 3.14195 // float64, an IEEE-754 64-bit floating point number c := 3 + 4i // complex128, represented internally with two float64s @@ -259,7 +259,7 @@ func learnConcurrency() { // that are ready to communicate. select { case i := <-c: // the value received can be assigned to a variable - fmt.Println("it's a", i) + fmt.Printf("it's a %T", i) case <-cs: // or the value received can be discarded fmt.Println("it's a string") case <-cc: // empty channel, not ready for communication. 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"; } |