Tuesday, August 18, 2009

Blocks on iPhone

I really do no need to start writing, but just one more thing that came out of last Thursday's meetup. We talked a little about when some of the cool Snow Leopard features like Blocks and Grand Central Dispatch might be coming to the iPhone.

Again, I'm purely speculating, but I think we will see blocks sooner rather than later, maybe in iPhone SDK 3.5. Grand Central Dispatch is harder to predict. Although there is some value in it now, since the iPhone has two processors - a CPU and a GPU - the real power of GCD comes with even more processing cores, and I have no idea if or when we'll get a multi-core iPhone.

But, blocks? Blocks on the iPhone would be cool, and you know what? You don't have to wait.

Sure, by using this, you don't get block support in the Foundation and UIKit classes, but you do get blocks, and you can always create categories to add block-based methods to existing classes, so you might want to check it out.



6 comments:

Dzamir said...

What is "Blocks"? I googled a lot and didn't find nothing.
Sorry for the ignorance! :D

Vincent C. said...

Sorry posted the wrong URL in my previous comment.
--
I am fairly certain blocks are synonymous with closures. MacResearch has a pretty good explanation on them.

Vincent

Jeff LaMarche said...

Dzamier:

Vincent is right. "Blocks" is the term for a proposed industry standard for C and Objective-C closures. It provides a way to pass code around as objects so, for example, NSDictionary could offer (and will in Snow Leopard) an iterate function that took a block to be executed on each of its items.

Very powerful, and to my knowledge, not very common yet in the world of compiled languages. And after listening to the problems the Apple engineers have had to solve to get it working, I understand why. They have to deal with problems like promoting stack variables to heap variables as blocks are passed between methods/functions. Gnarly stuff under the hood, but it will enable great things for us developers.

You should be excited about blocks. They are good things.

Jeff

Dzamir said...

I'm really excited now that I know what "Blocks" is :-)
I can't wait to start developing for Snow Leopard!

Glenn said...

Wow -- great minds think alike! The same day as your post, Mike Ash also posted quite a bit of detail using PLBlocks.

And now, with the release of Snow Leopard, John Siracusa also provides an introduction to blocks in Snow Leopard.

h4ns said...

What youre saying is completely true. I know that everybody must say the same thing, but I just think that you put it in a way that everyone can understand. I also love the images you put in here. They fit so well with what youre trying to say. Im sure youll reach so many people with what youve got to say.

Arsenal vs Huddersfield Town live streaming
Arsenal vs Huddersfield Town live streaming
Wolverhampton Wanderers vs Stoke City Live Streaming
Wolverhampton Wanderers vs Stoke City Live Streaming
Notts County vs Manchester City Live Streaming
Notts County vs Manchester City Live Streaming
Bologna vs AS Roma Live Streaming
Bologna vs AS Roma Live Streaming
Juventus vs Udinese Live Streaming
Juventus vs Udinese Live Streaming
Napoli vs Sampdoria Live Streaming
Napoli vs Sampdoria Live Streaming
Fulham vs Tottenham Hotspur Live Streaming
Fulham vs Tottenham Hotspur Live Streaming
AS Monaco vs Marseille Live Streaming
AS Monaco vs Marseille Live Streaming
Alajuelense vs Perez Zeledon Live Streaming
Alajuelense vs Perez Zeledon Live Streaming
Technology News | News Today | Live Streaming TV Channels