This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PRE-CONDITION: | |
* You already have "adb" tool available from the command line. | |
* Details on the various usage of adb is here: http://developer.android.com/tools/help/adb.html#Enabling | |
1) Connect the android device to the laptop using USB | |
2) Use the command below on your laptop to redirect the log to the file - say mylog.txt | |
adb logcat >mylog.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Download the ZIP from here: https://code.google.com/p/android-screen-monitor/ | |
* unzip it and extract asm.jar | |
* move it to your favorite location -- say ~ddesai/ | |
* connect the phone using USB | |
* run it "java -jar ~ddesai/asm.jar | |
and you will see the Android screen on your laptop (Mac!) | |
HowTos: | |
* You can select device by CTRL + D (or context menu) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://rypress.com/tutorials/objective-c/categories.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Multiple observers can register for the Notifications.. Similar to Broadcast/Receivers on Android |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
One-to-One relation (unlike Notifications - observers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dispatch_queue_t queue = dispatch_queue_create("com.paypal.dadesai.gcd", DISPATCH_QUEUE_SERIAL); | |
__block int x = 5; | |
dispatch_async(queue, ^{ | |
for(int i=0; i<10; i++) { | |
//x = x+i; | |
NSLog(@"Block 1: %d", x); | |
} | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Anonymous code block - which can be assigned to the variable. This code block can be passed as argument to another functions. | |
https://developer.apple.com/library/ios/documentation/cocoa/Conceptual/Blocks/Articles/bxGettingStarted.html#//apple_ref/doc/uid/TP40007502-CH7-SW1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
atomic //default | |
nonatomic | |
strong //default for objects | |
weak | |
retain | |
assign //default for premitives | |
unsafe_unretained | |
copy | |
readonly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) UI - UIKit - developed in objectiveC - need for UI | |
Class names starts with "UI" - e.g. UILabel | |
2) Foundation - developed in objectiveC | |
Class names start with "NS" - e.g. NSString | |
3) CoreFoundation - developed in C | |
Class names (actually structures) start with "CF" - e.g. CFString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface MyClass : NSObject | |
{ | |
int myInt; | |
NSNumber *myNumber; | |
} | |
- (void) doSomething; | |
+ (void) doSomethingElseWith:(NSNumber*) a; |
NewerOlder