Open Source: Massive Collection Of Objective-C Blocks Extensions

Objective-C blocks are a topic that I’ve talked about several times and I’ve mentioned this in-depth guide on blocks, and this slightly more digestible blocks for beginners tutorial.  Once you begin to understand blocks and start to use them you begin to start wishing that Apple would support them within more of the iOS SDK.

I’ve found an excellent library that does just that, and aims to put together all the open source Objective-C extensions supporting blocks into a polished and well documented library.

Here’s a list of some of the features provided taken from the project’s Github page:

  • Performing blocks on an NSObject.
  • Key-value observation (NSKeyValueObserving) using a block handler
  • Associated objects using an Obj-C API. (Not directly block-related.)
  • NSArray, NSSet, and NSDictionary filter utilities
  • BKMacros, for more quickly typing out the above.
  • NSInvocation creation using blocks
  • NSTimer block execution
  • UIAlertView, UIActionSheet with block callbacks
  • Block initializers for UIControl and UIBarButtonItem
  • Initializer for UIGestureRecognizer
  • On-touch utilities for UIView.
  • both delegation and block callbacks on NSURLConnection

The library is BlocksKit from Zachary Waldowski you can find the Github for the library here:
https://github.com/zwaldowski/BlocksKit

Now with this library you can experience the magic of blocks, and I really like how Zachary went to the trouble of providing documentation for everything.

©2011 iPhone, iOS 4, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.

.

DeliciousTwitterTechnoratiFacebookLinkedInEmail


How to Toggle Switch in iPhone

This is the very simple example. In this example we will see how we can change the background color
after toggling switch in the application. So let see how it will worked. My previous post you can find out
from here (Please attached the link).

Step 1: Create a View-base application using the template . Name the project “ColorChange”.

Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.

Step 3: Expand classes and notice Interface Builder created the ColorChangeViewController class for you. Expand Resources and notice the template generated a separate nib, ColorChangeViewController.xib for the SimpleExampleViewController.

Step 4: Open the ColorChangeViewController.h file and make the following changes in the file.

#import <UIKit/UIKit.h>
@interface ColorChangeViewController : UIViewController {
UISwitch*Switch1;
UIView *redView;
UIView *yellowView ;
}
@property (nonatomic, retain) IBOutlet UISwitch *Switch1;
@property (nonatomic, retain) UIView *redView;
@property (nonatomic, retain) UIView *yellowView;
– (IBAction)ChangeColor:(id)sender;
@end

Step 5: Double click the ColorChangeViewController.xib file and open it to the Interface Builder. First
drag the switch from the library and place it to the View Window. Connect File’s owner icon to the
switch and select Switch1, and select switch and bring up connection Inspector, connect Touch Up Inside
to the File’s Owner icon and select ChangeColor: method. Now save the .xib file, close it and go back to
the Xcode.

Step 6: In the ColorChangeViewController.m file make the following changes:

#import "ColorChangeViewController.h"
@implementation ColorChangeViewController
@synthesize Switch1,redView,yellowView;
– (void)viewDidLoad
{
[super viewDidLoad];
}
– (void)viewDidUnload
{
[super viewDidUnload];
}
– (IBAction)ChangeColor:(id)sender
{
UISwitch *swt = (UISwitch *)sender;
if (swt.on)
{
CGRect redFrame = CGRectMake(20, 140, 280, 300);
redView = [[UIView alloc] initWithFrame:redFrame];
redView.backgroundColor = [UIColor redColor];
[yellowView removeFromSuperview];
[self.view addSubview:redView];
[redView release];
}
else
{
CGRect yellowFrame = CGRectMake(20, 140, 280, 300);
yellowView = [[UIView alloc] initWithFrame:yellowFrame];
yellowView.backgroundColor = [UIColor yellowColor];
[redView removeFromSuperview];
[self.view addSubview:yellowView];
[yellowView release];
}
}
– (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)
interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end

Step 7: Now Compile and run the application on the Simulator.

You can Download SourceCode from here Toggle Switch Source Code.

Daily iPhone App: Radballs

I can’t say I’m really a fan of the name, but Radballs is a solid music puzzle app for iOS that reminds me a lot of Lumines (definitely not a bad thing). You need to match up little orbs in sets of 4 or more to make rounded-off rectangles, and then, just like in Lumines, a “beat bar” comes by to clear them off the board and earn you points.

You can grab the beat bar to “scratch” it for extra points, or use powerups as they drop to help you clear the board as well. The music is well-done (there are even some OK Go remixes in there) and ties into the gameplay very nicely, so you can listen and sort of make music as you play along.

It’s fun and fairly addictive, though things are even a little complicated — the tutorial is quite long, actually. The controls take a little getting used to as well; the balls will bounce around quite a bit, sometimes making precision moves tough to do.

Still, it’s a good game — if only that name was different. Radballs is a universal app for the iPad and iPhone that’s US$2.99 on the App Store right now.

Daily iPhone App: Radballs originally appeared on TUAW – The Unofficial Apple Weblog on Wed, 07 Sep 2011 08:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Apple begins shipping Thunderbolt displays

The Thunderbolt-compatible displays Apple announced back in July have reportedly started shipping out to stores and retailers. MacRumors reported that the displays shipped this week, and should hit shelves very soon. Electronista has heard that shipping to customers will start up on September 15, which is a little later than the original “60 days” we were promised. But late is better than never, right?

Honestly, these things are bee-youtiful, offering a 27-inch LED display, complete with an edge-to-edge design (hot!), a Facetime camera built in, a 2.1 speaker system, USB and Ethernet ports and of course a Thunderbolt port. If you’d like to get one, it’ll set you back a cool $999 — not cheap, but far from expensive for what you’re getting.

The MacBook Air above is, of course, not included.

Apple begins shipping Thunderbolt displays originally appeared on TUAW – The Unofficial Apple Weblog on Wed, 07 Sep 2011 07:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

On the road, and off with the Garmin USA nav app

Garmin has finally joined the ranks of GPS nav app providers that include maps on your device rather than requiring you to download them. I have tried a previous incarnation of the Garmin app on a trip to Northern Arizona, but I only saw a blue dot and no roads since I was in a place with no cellphone reception. No data, no map.

As a result, I was pleased to make another trip up north for some landscape photography and try this latest version with full maps on board. It’s a big difference. The maps seemed up to date and even had quite a few dirt roads. Even better, during a boat trip at Lake Powell the app was able to show me where I was and provide the boat speed. Although I couldn’t really use the app for navigation because it could only give me a straight line route to my destination, it did show the buttes and mesas around me accurately, and if I zoomed out enough I could pretty much get where I wanted to go.

As a traveling companion, the Garmin was just fine, and it mostly matched the capabilities of the Garmin stand-alone nuvi line. A built-in points of interest database worked pretty well when I was away from cell service, but when I had access to cellular data I could rely on the built-in Google services. I liked the ability to place a call directly from the points of interest screen, and the detailed and realistic graphics when exiting a freeway were helpful. When driving through Phoenix the larger buildings were rendered in 3D, and while I was more interested in looking at the road, the feature could be nice if you are stuck in traffic.

Navigation continued during phone calls, and the voices provided were intelligible, although I always wish the iPhone speaker had a few more decibels.

I only had one serious glitch. After getting back in the car and launching the app, it could never acquire a satellite signal. After ten minutes I gave up and tried again, but it still wouldn’t lock on. I completely re-booted the iPhone, and the app quickly grabbed its location. It could have been a bug in the app, or something in iOS; I only saw it once. Traffic information is US$19.99 a year, while my preferred Navigon app offers a lifetime traffic subscription for the same price. On the other hand, the Navigon USA app is $49.99 while Garmin USA is $39.99.

The Navigon series of GPS apps have been my long-time favorites. This new Garmin app is finally competitive, especially since the maps are on-board. Of course Garmin has recently purchased Navigon, and it will be interesting to see how the product lines merge and mix. I have no hesitation recommending the Garmin USA app if your travels take you out of the city and to places where data networks are sparse or non-existent. These apps also don’t drain your data plan, unless you opt to use the built in Google services, optional gas price directory or traffic features.

On the road, and off with the Garmin USA nav app originally appeared on TUAW – The Unofficial Apple Weblog on Wed, 07 Sep 2011 06:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Grad student translates iTunes Terms of Service into something more readable

Apple makes some beautiful products, doesn’t it? From the second you unbox that new iDevice, to the moment when you plug it in to your perfectly engineered MacBook and open up iTunes with the great OS X operating system — and then you see the iTunes Legal Agreement pop up, ugly as sin and a lot less interesting. Grad student Gregg Bernstein has put a little work into doing something that Apple hasn’t yet done: Make that clickthrough terms of service window a little more appealing and a little less like legal boilerplate. For his master’s thesis he went through Apple’s license agreement (all 4,137 words of it) and designed something that looked a lot more clean and beautiful, and actually meant something. Things like how many copies you can make of each item, and what you’re actually agreeing to when you click “Agree” are spelled out much more clearly.

So many of these user agreements are just noise, crafted by lawyers in a room somewhere, and put in by coders for companies who aren’t really interested in using them as anything but a big, bland legal shield (and clicked on by consumers who aren’t paying attention anyway). That’s why Bernstein’s idea is so great. Why not embrace beautiful design everywhere, even in the legal nonsense?

Of course, there are probably legal reasons (duh) that Apple’s license is implemented the way it is. But it would be nice for some company, any company, to step up and make this stuff easier and better for all involved.

Grad student translates iTunes Terms of Service into something more readable originally appeared on TUAW – The Unofficial Apple Weblog on Wed, 07 Sep 2011 00:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Objective-C rocketing up the TIOBE charts

The TIOBE index is a chart of what have been rated as the most popular programming languages in the world, according to various searches online, the number of experts in those languages, and even software output (though it is very certainly not a strict chart of “most lines written”). Obviously, it can’t be perfect, but it’s at least a very simple indicator of what kinds of computer languages developers are using at any given moment.

Look what has appeared at spot number 6: Good old Objective-C, the language that Mac and iOS developers use to code Mac and iOS apps. Mac and iOS development are gaining in popularity lately, thanks to both the Mac and iOS App Stores, and lots of developers are either jumping in to Objective-C development for the first time, or deciding to flex their coding muscles even more (often by leaping into the iOS fray).

This chart shows just how phenomenally Objective-C is growing lately — just since 2009, developers have started flocking to the platform in droves. That’s pretty amazing. Part of it, of course, is that Apple has poured a lot of resources and development time into building up Objective-C and Xcode alike, but I don’t think you can overestimate just how powerful the growth of the App Store as a distribution platform has been for Objective-C and its apps.

[via DF]

Objective-C rocketing up the TIOBE charts originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 06 Sep 2011 22:31:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Facebook iPhone app gets big update, iPad version still MIA

Facebook’s iPhone app has been updated to version 3.5, and it’s a pretty big update. The most notable change is to the Update Status area, which now allows you to tag friends, change sharing options, and add media/locations from the same screen. It streamlines the process of status updates quite a bit. The in-app browser also allows you to share links on Facebook much more easily than before.

Still missing in action is the long-awaited iPad version. In fact, reports from around the web indicate that the iPad assets have been completely expunged from this version of Facebook’s app, meaning that jailbreakers will no longer be able to enable them on their iPads. Hopefully the iPad version will see its official release soon.

The list of changes and improvements in Facebook for iPhone 3.5 is below. Note that while Facebook claims to have fixed bugs related to photos, in my case there’s a new one: I have two entries for “Photos” in the grid view now.

Made it easier to share with who you want

  • Added the ability to tag friends and places in posts
  • Added the ability to share external links from a web view
  • Added new design for Profile and Group Walls
  • Improved the sharing tool to add privacy controls on posts and match your settings on the web site

Improvements and bug fixes:

  • Improved Notifications speed
  • Fixed a number of Chat bugs
  • Made it easier to select filters in News Feed
  • Fixed a bug with the Notifications bar disappearing
  • Fixed a number of Photos bugs
  • Improved performance and stability overall

Facebook iPhone app gets big update, iPad version still MIA originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 06 Sep 2011 21:40:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Daily iPad App: Monster Coloring Book

Monster Coloring Book is so adorable that I had a hard time putting it down long enough to write a review. It’s an iPad coloring book that has a series of monsters you can “color” using your finger as a brush or tapping to fill an area. If you find that the iMarker/Crayola ColorStudio HD combo is a bit too costly, this is Monster Coloring Book is a much cheaper alternative without the stylus.

There’s quite a few options that can be chosen including different colors, brushes, stickers and patterns. You can change the size on the brushes to make sure you keep inside the lines. You can share your creation in a gallery on the app, email, print or export it. You can listen to music while you or your child (come on, we know you’ll use this too) color, including some classical tracks to introduce new composers.

The free app comes with one brush and the option to purchase more with an in-game currency called Monsterbucks. You start off with 1,000 Monsterbucks in the free game, so you can add on a couple of brushes or purchase an extra monster or two before you’re prompted to buy more. Also, performing some activities will net you a few extra Monsterbucks. All of the starter monsters are free, so there’s plenty to experiment with before deciding if you want to purchase more. There are 150 pages in all that can be acquired.

There are a couple of caveats. When you try to purchase Monsterbucks in the app, it doesn’t let you know how many real-life dollars the purchase is. As seen from the fiasco over the Smurfs Village app, this could potentially cause a problem. However, if you want full access to all the features without dealing with the in-game currency, get $1.99 paid app. All of the app content is unlocked, so it’s much cheaper than purchasing in-game currency.

The tools work well, except I have a difficult time rotating some of the stickers using the 2-finger rotating gesture. A cheat sheet pops up when you use stickers so it’s easy for new users to figure out how to reshape and rotate them.

Monster Coloring Book is definitely an app to have on your iPad for kids of all ages — and the adults who still have the desire to try to color inside the lines.

Daily iPad App: Monster Coloring Book originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 06 Sep 2011 20:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Shake-to-Undo on the Mac via open source app

This is funny: I’ve only really ever used the “shake-to-undo” on the iPhone either by accident, or when it wasn’t actually available (when I had to undo something, and thought the app I was using supported it). But it can be a handy feature for some, and because of that, someone (named Nate Stedman) has “ported” it over to the Mac, available for download on your laptop MacBook, MacBook Pro, or Air. In other words, install the app, and then whenever you shake your portable Mac, the accelerometer inside will try whatever Ctrl-Z does on the app you’re working on, essentially implementing “shake-to-undo.”

Like I said, funny. This is more of a joke than anything else — it’s not really practical to be shaking your MacBook around every time you want to undo something. But “Shake-to-undo” is pretty cheesy as it is, and it’s extra silly to be flinging your device around on a bigger computer. Apple’s brought quite a few iOS features over to Lion lately, but this is one that should probably just stick to the smaller devices.

Shake-to-Undo on the Mac via open source app originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 06 Sep 2011 19:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

DocsFlow links Google Docs to Adobe InDesign layouts

Earlier this afternoon, I had lunch with a co-worker, and we discussed the pros and cons of using Google Docs in newsrooms. The idea of leveraging Google’s free web-based rich text editor for collaborative editing & then flowing those bits of copy into InDesign for newspaper or magazine layout is a sound one, but one of the issues is that there’s no direct integration with Adobe InDesign that other solutions (such as Adobe InCopy or Woodwing’s products) have.

Almost as if they overheard us, Em Software (developer of the legendary QuarkXPress database publishing tools EmData and Xtags) has released the DocsFlow plug-in for InDesign that integrates Google Docs with Adobe’s publishing software. Although it bills itself as not being a direct competitor to InCopy (no edit-to-fit functionality, for example), it’s an interesting product on its own merits.

InCopy is great for formatting, line breaks, handing copy overflow, etc., and I like it a lot. Google Docs, in turn, excels at collaboration. It allows editing of the copy in real time and an individual document can be accessed by multiple people simultaneously. For example, if I’m working on a page and the reporter wants to correct something in the story, they can just edit the Google Docs story connected to the InDesign file, and it’s instantly updated.

The plug-in itself works beautifully and is very stable. I tested it with Victor by placing a document from Google Docs on a blank InDesign page, then I gave Victor edit permissions.

Before:

Then, the links panel alerted me of a change:

After:

DocsFlow looks like it will be a great tool for freelancers or smaller publications that can’t afford traditional pagination systems (which can cost many thousands of dollars and require complex system integration services). The plugin requires InDesign CS 5 or higher, and it’s free to try with a single Google Docs story. A full license is $200 per InDesign seat, and it supports an unlimited number of Google Docs collaborators.

DocsFlow links Google Docs to Adobe InDesign layouts originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 06 Sep 2011 18:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Study finds post-Steve Jobs consumer optimism

The general consensus before Steve Jobs resigned from Apple was that, when he did so, people would expect Apple to go downhill from there. However, an analysis by ConsumerAffairs finds that people’s view of Apple and its future actually became more positive after Jobs resigned.

ConsumerAffairs analyzed 27 million Tweets, Facebook comments, and sentiments from other social networking sites over the previous twelve month period. After August 24th, the day Steve Jobs resigned, positive sentiments for Apple hit a high for the year. ConsumerAffairs says that out of 234,000 comments in August, 50% were positive, 30% were neutral, and only 20% were negative. Typical comments included: “Apple will be fine thanks to his [Jobs’] leadership” and “Apple is incredibly solid thanks to him [Jobs].” Also of interest is that of the 20% of comments that were negative, most of those focused on pricing or technical issues with Apple products, rather than the perceived outlook in the future of the company.

Overall, Steve Jobs’ resignation has had little material impact on Apple (the stock is currently about $5 higher than its close the hour before Jobs’ resignation was announced), but as the ConsumerAffairs analysis shows consumer faith in the company also moved in the opposite direction many would have expected it to.

Study finds post-Steve Jobs consumer optimism originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 06 Sep 2011 17:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

mTrip offers free iPhone travel guides

For any of our readers planning to take a trip you’ll want to check out the list below to see if your destination city is there. For this week only, mTrip is offering its popular iPhone travel guides for free. Different guides are available for free each day of the week. All of mTrip’s travel guide apps are usually $5.99, so be sure to grab them for free while you can! The giveaway is in celebration of mTrip’s new social sharing features, which allows users to share photos, reviews, and more with their friends through mtrip.me.

The schedule:

Tuesday, September 6:

Paris
Amsterdam
Vienna
Tokyo
Budapest

Wednesday, September 7:

London
Berlin
San Francisco
Madrid
Dublin
Shanghai

Thursday, September 8:

New York
Rome
Istanbul
Singapore
Prague

Friday, September 9:

Barcelona
Venice
Hong Kong
Munich
Stockholm

mTrip offers free iPhone travel guides originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 06 Sep 2011 16:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Daily Mac App: Adium

Adium IM client

Instant messaging is an essential part of modern communications. On the Mac, we’re blessed with the excellent iChat, but Apple’s built-in IM solution doesn’t connect to every protocol, so that’s when we turn to Adium.

Adium is a great long-standing piece of open-source Mac software. The reason it’s so good is that it connects to almost every IM protocol under the sun. Gtalk, Facebook IM, Live Messenger, Yahoo, AIM, Jabber, IRC, you name it, Adium will let you chat using it.

The Swiss Army Knife of chat clients, Adium not only let’s you connect and chat, but does it in a very customizable, yet Mac-like way. You’ve got Growl support, plugins, a menu bar icon, sounds, notifications and alerts for every action and a highly recognizable icon, even if it doesn’t scream “chat” to you at first glance.

Setting up Adium couldn’t be easier. Select the desired protocol, plug in your login details and you’re good to go. Your buddy list is downloaded from the respective sites and blended together in one list. You can sort by protocol or create your own groupings. Cross-protocol chat isn’t possible for those that don’t have interoperability, but that’s no fault of the chat client. Adium is purely text-based, there are no built-in options for video or audio chat at the moment, but you can send files for protocols that support file transfer.

Adium is available for free from the Adium team’s site, and works great on almost all versions of OS X including Lion. If you’ve got friends spread across a plethora of IM protocols, let Adium simplify things and get you chatting to them all from one great client.

Daily Mac App: Adium originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 06 Sep 2011 15:30:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Sonos updates software for iOS 5, Lion

It has taken a long time but the Sonos software is now Lion friendly. When Lion came out in July, Apple substantially changed the way shares work, and the popular Sonos home music system depended on the SMB protocol to share with your iTunes library. In Lion, Apple moved to a proprietary method, and that started the problems and caused a lot of anger among Sonos owners. Streaming services like Pandora, SiriusXM, or Spotify worked fine, but you couldn’t get access to you own music if you had your files on your main computer or an external drive. Some people had their music on a Network Attached Storage device, or NAS, but Lion broke some of those as well.

I’ve tested the Sonos update, and it does the trick, which will make music starved Sonos customers happy. If you are using the iOS Sonos remote apps have an update today as well. Happy listening.

Sonos updates software for iOS 5, Lion originally appeared on TUAW – The Unofficial Apple Weblog on Tue, 06 Sep 2011 15:15:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments