pattern in objective-c