C# | Objective-C |
---|---|
Initialize String | |
string str = @"x"; | NSString *str = @"x"; |
Append String | |
string str1 = "a"; string str2 = "b"; string str3 = str1 + str2 |
NSString *str1 = @"a"; NSString *str2 = @"b"; NSString *str3 = [str1 stringByAppendingString:str2]; More |
//Definition //Not required //Declaration void MyFunction() { } //Invocation MyFunction(); |
//Definition (ViewController.h)
@interface ViewController : UIViewController
-(void) MyFunction;
@end
//Declaration (ViewController.m)
@implementation ViewController
- (void) MyFunction
{}
@end
//Invocation (ViewController.m)
[self MyFunction];
|
//Definition //Not required //Declaration string GetGreetings(string strName) { return "Hello " + strName; } //Invocation string strResult = GetGreetings("Usman"); |
//Definition (ViewController.h)
@interface ViewController : UIViewController
@end
//Declaration (ViewController.m)
@implementation ViewController
{
return [@"Hello " stringByAppendingString:strMessage];
}
@end
//Invocation (ViewController.m) |
Sunday, March 17, 2013
Cheat Sheet
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment