15 Oct '12, 12am

UITextField and Blocks:

If you've ever used a UITextField in an iPhone project (or, I suppose, an NSTextField in a Cocoa project) you know that you pass it a delegate object in order to respond to events. Handling the "Return" key press from the on-screen keyboard may look something like this (probably implemented in your view controller): - (BOOL)textFieldShouldReturn:(UITextField *)textField { if (0 == [textField.text length]) { return NO; } [self doSomethingWithText:textField.text]; [textField resignFirstResponder]; return YES; } The delegate pattern is de rigueur for Cocoa classes, so you've likely never given this much special thought. Unless, that is, you decided at some point to have two text fields on screen at once. With two text fields you need to handle two sets of callbacks. You have a couple options for how to do this: Use the same delegate to handle both sets of callbacks, and use c...

Full article: http://pivotallabs.com/users/adam/blog/articles/1353-ipho...

Tweets

Twitter says blocks German neo-Nazi account in world first

Twitter says blocks German neo-Nazi account in ...

straitstimes.com 18 Oct '12, 8am

In this Sept 25, 2012 file picture a police officers shows a confiscated Nazi flag at a press conference in Hanover, Germa...

Myanmar blocks Islamic body's office after prot...

straitstimes.com 15 Oct '12, 10am

NAYPYIDAW (AFP) - Myanmar's president blocked a world Islamic body from opening an office in the country, an official said...