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.

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"); };


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.

Almost End of April 2017

Hola! So bertemu lagi dalam blog iReka. So saya baru sahaja menyiapkan  mengupdate Mac App 'App Icon Resizer' ni. Yeah! Ape...