Tuesday, 22 October 2013

GCD & Blocks

Grand Central Dispatch
• Perform complex actions in response to user input while remaining responsive.

Threading Basics
• Process can contain multiple threads, while all run concurrently.

mutex: mutual exclusion, or a lock, which ensuring that particular chunk of code can't be run by multiple threads at once.

thread-safe: Foundation framework (containing basic classes approprite for all sofrts of Obj-C programming, such as NSString, NSArray and so on) is generally considered to be thread-safe.

not thread-safe: UIKit framework (containing the classes specific to building GUI such as UIApplication, UIView and all it subclasses and so on).

main thread UIKit objects should be executed from the sam thread.

Queue: queue that 's quaranteed to always do its workd on the main thread.

Blocks
Also known as closure or lambdas in other languagess. Much like a method or function, a block can take one or more parameters and specify a return value. To declare a block variable, you use the caret (^) symbol along with some additional parenthesized bits to declare parameters and return types.''

`void (^loggerBlock)(void)`

`loggerBlock = ^{ NSLog(@"Hi"); };

`loggerBlock();`

GCD + Blocks


   dispatch_queue_t main_queue = dispatch_get_main_queue();
    dispatch_async(main_queue, ^{

    [self createPieces];

    dispatch_async(main_queue, ^{

        [self addAnothePieceToView];

    });
   });

Monday, 21 October 2013

Table View

Table view is commonly used in iOS apps. It's efficiently manage the repeatly cell. The easy way to use  table view is by using UITableViewController or UITVC.


Moving Out in Cyberjaya

I have been busy for weeks for moving out phase. I am moving out from terrace to a condo house also in Cyberjaya. So there is so much help...