Sorting NSArray of custom objects with more nesting

Sorting an array of custom objects is fair simple. NSSortDescriptor works awesome for this. Lets see an example:


@interface Parent : NSObject
@property(strong, nonatomic) NSString *name;
@end
NSArray *arrayOfParents = @[parent1, parent2];

If I want to sort array of parents by their name then I would use something like:

CONTINUE READING

drawViewHierarchyInRect vs renderInContext

I came across very curious problem whose cause I couldn’t have come to know about it without serious debugging because this was something that didn’t catch my attention. I had a task that required capturing snapshot of UIView with hierarchy of subviews and perform few interactive transformation animations on view immediately after - giving feeling of instant multitask. Delay should have been negligent for naked eyes or tolerant but it wasn’t.

CONTINUE READING

My first x86-64 assembly in macOS

I am reading a book Coders at work. Each chapter consists of interview with an experts in the field of computer programming, engineering and science. Most of them had started programming during 70’s-80's, the time when there wasn’t many choice of programming languages available like modern day. Most of them were programming in low-level like assembly or binary. I was thrilled and excited from reading of their journey. It motivated me to learn small things about assembly and learn more about machine closely. I am writing this blog post on my journey of learning assembly.

I have a macbook pro. It’s a 64-bit machine. Intel based. I started collecting information on resources and tips to get started. My machine is x86-64 so it is x86 assembly. I found little resources on starting assembly on mac, and among what I found was for linux. Throughout the search I have collected good blogs and resources that I’ll be sharing. This post is more about what I am discovering or learning rather than tutorial.

CONTINUE READING
Newer posts