UIButton *button=[UIButton buttonWithType:UIButtonTypeRoundedRect];[button setTranslatesAutoresizingMaskIntoConstraints:NO];[button setTitle:@"action" forState:UIControlStateNormal];[self.view addSubview:button];NSLayoutConstraint *btnCon=[NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:[button superview] attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-20.0];NSLayoutConstraint *btnCon2=[NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:[button superview] attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-20.0];[self.view addConstraint:btnCon2];[self.view addConstraint:btnCon];
2013年3月31日星期日
Auto Layout Demo code
2013年3月19日星期二
Facebook iOS position interview question
last week Facebook recruit found me in LinkedIn, so he ask me if you would be interested in iOS opportunities within Facebook. I currently live in Shanghai,China, if have a chance go to bay area wok is biggest change in my life. So I accept his request.
next is recruiter test question :
yesterday Facebook Engineer give me a Skype interview:
others question:
how runloop work and autorelease object?
will lead to myButton retain target self?
_fireTargetsAndActionsForEvent complexity?
Today morning, I receive recruiter mail, he told I don't get chance to next round interview.
I'm very sad, maybe there have many candidates who are best than me. So I don't have chance work for the company, the interview experience is good for me.
next is recruiter test question :
another question : what does KVO stand for?Question 1: When running out of memory, how does the system give your app one last chance to prevent being killed?a) Autoreleaseb) Jetsamc) Memory Warningd) UIApplicationWillTerminateNotification Question 2: What is the difference between a UIView's 'frame' and its 'bounds'a) 'frame' defines the view's position and size; 'bounds' defines its clipping rectb) 'frame' defines the view's clipping rect; 'bounds' defines its position and sizec) 'frame' defines position and size in the coordinate space of its superview; 'bounds' defines position and size in the coordinate space of the view itselfd) They are equalQuestion 3: The delegation pattern is often used to:a) Report value changes from a Model to a Controllerb) Communicate messages back from one object to its owning objectc) Broadcast messages from a singleton object (e.g. NS User Defaults) to its listenerd) All of the aboveQuestion 4: Which of the following cannot be retained:a) NSString literalb) NSNullc) NSIntegerd) NSNotificationQuestion 5: A block cannot:a) Be subclassedb) Be retained or releasedc) Access 'self' from the scope in which it is declaredd) Be passed as an argument
yesterday Facebook Engineer give me a Skype interview:
@interface UIControl: UIView- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents;@end@implementation UIControl- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents{// How would you implement this?}// A UIControlEventTouchUpInside just happened. Let every interested target know…- (void)_fireTargetsAndActionsForEvent:(UIControlEvents)controlEvent{// ???}[myButton addTarget:self action:@selector(didTapButton:) forControlEvents:UIControlEventTouchUpInside];
others question:
how runloop work and autorelease object?
will lead to myButton retain target self?
_fireTargetsAndActionsForEvent complexity?
Today morning, I receive recruiter mail, he told I don't get chance to next round interview.
I'm very sad, maybe there have many candidates who are best than me. So I don't have chance work for the company, the interview experience is good for me.
订阅:
博文 (Atom)