HelloWorld Example in Xcode 4 – iPhone OS 4.3

This is the “Hello World” example. I am going to execute the Hello World example in a new version of Xcode. So many things are new in this Xcode 4.

Xcode 4 is the complete toolset for building Mac OS X and iOS applications, the tools have been redesigned to be faster, easier to use, and more helpful than ever before. The Xcode IDE understands your project’s every detail, identifies mistakes in both syntax and logic, and will even fix your code for you. Quite simply, Xcode 4 will help you write better code.

So let see how it will be work.

Step 1: Open a Xcode, select Create a new Xcode project (See fig 1) and click open button.
Figure 1

Now select ViewBase application and click next (See figure 2)
Figure 2

Next page you need to define Product name and Identifier name, the identifier is the name of your application. It’s the same name used when you register your application at Apple’s website and release it to the AppStore. The Product name “HelloWorld Xcode4” and the Identifier name “com.mycompany.APPLICATIONNAME” (See figure 3). Select the Device Family into iPhone. Now select next and save the application in your disk.
Figure 3

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 (See the figure 4).
Figure 4

Step 3: Expand classes and notice Interface Builder created the HelloWorld_Xcode4ViewController class for you and generated a separate nib, HelloWorld_Xcode4ViewController.xib, for the “HelloWorld_Xcode4”.

Step 4: Select the HelloWorld_Xcode4ViewController.h file from the Project Navigator. We have added UILabel for display the text and added IBAction buttonPressed; in the file, so make the following changes in the file.

#import <UIKit/UIKit.h>

@interface HelloWorld_Xcode4ViewController : UIViewController {
 
    IBOutlet UILabel *label;
       
}
@property (nonatomic, retain) IBOutlet UILabel *label;

(IBAction)buttonPressed;

@end

Step 5: Double click the HelloWorld_Xcode4ViewController.xib file from Project Navigator. Now the .xib window will look like (figure 5).
Figure 5

a) Now drag the label and RoundRect button from the object (See figure 6).
Figure 6

b) Select Label from the Window and change the label Text name from the Attribute Inspector (See figure 7). Give the Text name “Hello World!!!”.
Figure 7

c) Next select the RoundRect Button from the window and select Attribute Inspector (See figure 8). Give the Title “Click Me”.
Figure 8

d) Now connect File’s Owner icon to the “Hello World!!!” label and select label (See figure 9).
Figure 9

e) Select “Click Me” button and bring up Connection Inspector (See figure 10) and connect Touch up Inside to the File’s Owner icon and select buttonPressed: method.
Figure 10

f) Select File’s Owner icon to the View window and select view (See figure 11).
Figure 11

Now save it and open the HelloWorld_Xcode4ViewController.m file from the Project Navigator.

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

#import "HelloWorld_Xcode4ViewController.h"

@implementation HelloWorld_Xcode4ViewController

@synthesize label;

(IBAction)buttonPressed{
        if ([label.text isEqualToString:@"Hello World!!!"])
                label.text = @"Hello iPhone!!!";
        else
                label.text = @"Hello World!!!";
}

(void)dealloc
{
    [super dealloc];
}

(void)didReceiveMemoryWarning
{
    // Releases the view if it doesn’t have a superview.
    [super didReceiveMemoryWarning];
   
    // Release any cached data, images, etc that aren’t in use.
}

(void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end

Step 7: Now Compile and Run the application and see the Output in the Simulator.

You can download source code from here HelloWorld_Xcode4

Using Your iPhone in Social Situations: How Much Is Too Much?

iPhone Social Situation

I remember when I was a kid and my teenage sister got a T-Mobile Sidekick. It was the first “smartphone” I had ever heard about, and I was always impressed (and kind of jealous) by how she could chat with her friends on it and check her email all the time.

My parents, on the other hand, may have regretted buying my sister the Sidekick, because she was always glued to it, even at dinnertime.

“Get off that thing now!” my father would scold her when she’d be constantly clicking away on the Sidekick keyboard, messaging back and forth with her friends even when we were supposed to be having “family bonding time.”

I always thought it was kind of rude of my sister, too… until I got an iPhone.

The Dawn of the iPhone

The first couple of years after the iPhone was introduced marked the first time that people had full-fledged computers in their pockets. Yes, there were Blackberry phones and mobile browsers, but let’s be honest: nothing like the iPhone, at least nothing that was widely adopted.

All of a sudden, people had access to advanced mobile technologies and all of the information in the world literally at our fingertips, whenever we wanted it. The iPhone changed our society.

iPhone & Social Implications

As an early adopter of the iPhone, I had a lot of fun using my iPhone to take advantage of social situations. For example, when an argument would ensue about which Hollywood movie grossed the most last year, I would sneak on my iPhone, find out the answer, and act like I was just that intelligent.

Nowadays, using a smartphone in public is common. So many people have one. The problem is that as mobile technology advances and becomes more widely accessible, we now have a responsibility to moderate our mobile habit so that it doesn’t get in the way of our social lives.

Using Your iPhone in Public

I am accustomed to pulling out my iPhone from time to time in social situations, either to check something regarding my own personal life (a text message, an email, a Facebook message) or to enhance a conversation. For example, the other night my friends and I were recalling a childhood cartoon and I pulled out my iPhone to search for an image of said cartoon and show it to them.

But recently, a friend called me out for using my iPhone in a social situation.

“It takes you out of the moment,” she argued. “And it’s just kind of rude.”

I could see where she was coming from, especially because I’ve been in the position where I am talking to someone and they rudely pull out their phones and interrupt the situation.

On the one hand, it’s a wonderful luxury to be able to connect with your social network (answer phone calls, reply to Facebook wall posts, respond to text messages, etc.) on the go. On the other hand, it can be kind of rude to ignore the people you are with in favor of your iPhone.

Which brings me to the big question…

Is It Rude to Use Your iPhone in Public?

To what extent is it permissible to use your iPhone in social situations? Are we being rude by pulling out our iPhones when we are out with friends, at the cash register, at the dinner table, etc.?

Society is changing so quickly because of smartphone technology, so we now have a responsibility to figure out how to moderate our iPhone use.

What do you think? When it comes to using your iPhone in public, how much is too much? I would love to hear your opinion in the comments.

Using Your iPhone in Social Situations: How Much Is Too Much? is a post from Apple iPhone Review.


For the first time ever, Apple beats Microsoft in quarterly profit

Today Microsoft announced their net profit for the first calendar quarter of 2011. That net profit was $5.23 billion, or $760 million dollars less than Apple’s $5.99 billion net profit over the same period. For those keeping track, first Apple surpassed Microsoft in market capitalization, next they surpassed Microsoft in quarterly revenue, and now Apple has surpassed Microsoft in quarterly profits. Surpassing Microsoft’s net profit is quite an accomplishment given the typical high-margin sales of Microsoft’s software and the lower-margin sales of Apple’s hardware.

Matter of fact, by every standard financial measure, Apple has now surpassed Microsoft to be the most profitable and valuable tech company on the planet. No wonder some people think Apple is headed to be the first trillion dollar company.

[via MacRumors]

For the first time ever, Apple beats Microsoft in quarterly profit originally appeared on TUAW on Thu, 28 Apr 2011 23:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Zynga buys Wonderland Software, makers of GodFinger

Zynga has added another iOS developer to its growing stable — Wonderland Software, makers of GodFinger, the Ngmoco-published freemium title, has been purchased and rebranded as Zynga Mobile UK. Wonderland made GodFinger for Ngmoco, so that game isn’t part of the buyout, but Zynga will of course use the company and its resources to build up a developer presence in the UK for both mobile and social games.

This buyout follows the purchase of two other big iOS developers by Zynga, including Drop7 dev Area Code, now Zynga New York, and Words with Friends’ Newtoy, which has seen been rebranded as Zynga with Friends. That’s quite a growing empire Zynga is building out of iPhone developers, and I’m inclined to say we’ll see a few more studios bought up in the future. What we haven’t seen quite yet is just what these studios are doing for Zynga — Words with Friends has been marked with a Zynga logo, but Zynga’s iOS push doesn’t have any new games to play with yet. Hopefully we’ll see the fruits of these deals at some point.

Zynga buys Wonderland Software, makers of GodFinger originally appeared on TUAW on Thu, 28 Apr 2011 22:30:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Box.net SimpleShare Mac app for free screencast and screenshot sharing

Cloud storage provider Box.net has announced a new free Mac app called SimpleShare to make sharing screenshots and screencasts with others a piece of cake.

When installed and used with a free (5 GB) or paid Box.net account, SimpleShare appears as yet another menu bar icon. To capture a screencast to demonstrate a feature or bug, selecting “Start Screencast” from that menu brings up a selection tool to drag around the area you want to capture. The capture begins immediately, and is stopped by clicking a “Stop Recording” button that appears on the screen. Once recording has ceased, the screencast is uploaded to Box.net’s servers and the light blue menu bar icon “fills up” as a progress indicator.

As soon as the file upload is done, a unique address is generated for sharing the screencast or screenshot with friends or coworkers, and that address is copied to the clipboard for pasting. I noticed that every time the screencast was viewed for the first time, I received an email — that’s a nice touch if you want to make sure that your co-workers have viewed the content. To send other files on your Mac, you just drag them up to the menu bar and drop them on the Box.net icon. For screenshots, just using the traditional Command-Shift-3 or Command-Shift-4 shortcuts automatically sends the full screen or selection to your SimpleShare folder.

I wasn’t happy with the fact that the screencasts are saved in the Adobe Flash Video format, as that makes it impossible to view the videos on iOS devices. But this is a 1.0 app, and hopefully Box.net will migrate to a more compatible screencast format in the future.

While cloud storage services like Box.net are not unique — I tend to use Dropbox for most of my cloud work — SimpleShare is useful for collaborating with others thanks to its drop-dead ease of use. For me, it’s a keeper.

Box.net SimpleShare Mac app for free screencast and screenshot sharing originally appeared on TUAW on Thu, 28 Apr 2011 21:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Apple patents Fitness Center App for iPhone

Patently Apple’s got another USPTO-sponsored bulletin from the R&D Department in Cupertino, and this time it’s for a brand new app designed to help you stay in touch with your local gym. A recently published patent details a Fitness Center App that will do things like track your workouts from exercise machines, mark down when and where you visit the gym, and even find a workout partner with social networking or set up appointments for personal trainers straight from the app. [Maybe they’ll call it “QuadsSquare.” -Ed.]

In short, Apple’s idea is that one app would govern all facets of an exercise program, with a heavy back-end system to work with different gyms all over the country. You’d be able to get news and information straight from your local gym, as well as custom reminders when you miss a workout or haven’t been in a while.

It all sounds good to us. While most of Apple’s patents are usually just the company covering its bases, this one seems awfully in-depth — everything from concepts to layouts is covered here. That doesn’t mean this idea is any more likely to actually be implemented, but it does mean that Apple has put lots of thought and effort into an app like this. Maybe we will see it implemented as an actual release.

Apple patents Fitness Center App for iPhone originally appeared on TUAW on Thu, 28 Apr 2011 19:15:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

iPhone: "Does this white paint make me look fat?"

Ryan Cash had an opportunity to compare the new white iPhone with the more traditional black model that many of us know and love. Placed side-by-side on the desk, it appears that the white model is ever so slightly thicker. This is possibly due to a need to filter light, a design problem originally floated back last October and confirmed this week by Steve Jobs.

Apple does not list any technical specification differences between the two models. If you’ve got a new iPhone 4 blanco, please let us know if you have any difficulty using an existing case or cover with it.

iPhone: “Does this white paint make me look fat?” originally appeared on TUAW on Thu, 28 Apr 2011 18:30:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Instapaper’s free version goes on extended hiatus, dev explains why

Marco Arment has an interesting writeup on his blog about his iOS app Instapaper (and of course the web service that runs behind it). Arment says on his blog that he’s quietly been removing the free version of the app from the App Store, and that’s resulted in a surprising effect: Sales of the full app have actually increased. Because of this, Arment says he’s rethinking a free version completely, and may not bother ever bringing it back to the App Store.

Traditionally, free or “lite” app versions are very helpful — they give users a taste of what the app does without any overhead costs to them but the time to download, and they can raise awareness of an app in certain situations. Of course, the drawbacks are that a free app doesn’t make any money, and can often be a drain on resources, requiring extra development time or support.

That’s where Arment says his problem comes in — the free app isn’t really worth it, doesn’t convert to paid as he’d like it to, and perhaps most interesting, actually causes some “image problems.” A lot of free users don’t realize that the free version has a limited featureset, so they aren’t even seeing what the full Instapaper app can do. Moreover, the reviews for the free app (drawing from a pool of users who haven’t invested anything in the app, and can “download and dump” but still review it) are noticeably worse than those for the paid version.

The whole post is intriguing, and really goes against some of the conventional wisdom on free versions of apps. Of course, I think games are different than Arment’s service, but it’s true — while a free app will likely grab you a larger audience than just putting out a paid version, it still may not be the best thing for a specific app to do. Instapaper Free is gone for now, says Arment, and it may not be back at all.

Instapaper’s free version goes on extended hiatus, dev explains why originally appeared on TUAW on Thu, 28 Apr 2011 18:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Newspaper thinktank predicted the iPad in 1994

It’s not often (well, ever) that I consider the possibility someone might be from the future, but maybe Roger Fidler was. In 2007 the Paleofuture blog pointed to the video below, where Fidler and his team at Knight-Ridder describe an electronic newspaper running on what might as well be an iPad… except that the video was made way back in 1994.

Most futurists are off the mark, or make forecasts for technologies that are so far off in the future, you’ll never know if they are right, but the Knight-Ridder team’s predictions for the “electronic tablet” were just eerie. Granted, they forecast it for the turn of the century — and in their version of the future, people still wore collarless denim shirts — but it’s otherwise freakishly accurate.

“We may still use computers to create information, but we will use the tablet to interact with print, video, and other information,” the video explains. It also goes on to describe personal “profile pages,” “interactive maps,” and sharing links with friends. And that’s just the tip of the iceberg. It even seems like Fidler is channeling Steve Jobs at some points, saying “Nobody needs a manual for their daily newspaper” and that tablet newspapers need to be kept simple. Amazingly, he even seems to describe iAds.

Of course, the Knight-Ridder tablet wasn’t the first futurist’s take on a pad-shaped newsreader, but at least this one doesn’t also come with a neurotic killer computer in space.

If you were watching this video in 1994, you were watching thirteen minutes of the future. Read on to see the clip. Bonus points to Fidler & co. for the classic PowerBook Duo, Newton and other Apple history in the background.

[via The Inquisitr; hat tip to Bronwen Clune]

Continue reading Newspaper thinktank predicted the iPad in 1994

Newspaper thinktank predicted the iPad in 1994 originally appeared on TUAW on Thu, 28 Apr 2011 17:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Scosche freeKEY Bluetooth keyboard: flexible and splashproof

Have you ever wanted to spill water onto your Bluetooth keyboard? Of course not. But that doesn’t mean that some day you might not accidentally dump an icy glass of sweet tea onto the keyboard or have one of the kids decide to give Mr. Keyboard a bath in the toilet.

Schosche’s new freeKEY Bluetooth keyboard (US$59.99) doesn’t mind spills, although a swim in the loo might prove too much. The chiclet-type keyboard rolls up like a frightened armadillo for compact travel and is made of a water-resistant silicone material. When it gets wet, simply shake it off. Chiclet keyboards have been known to be typing-unfriendly in the past, so you may want to try one out at a local retailer before buying.

The freeKEY is available now, works with all of your Bluetooth-equipped devices, including the iPad 2, and comes with a retractable USB to micro-USB cable for recharging. There’s video on the next page, showing the freeKEY in action as it gets splashed and rolled up into a snug cylinder. I’m hoping to try one out soon for a full TUAW review just to see how comfortable the keyboard is, and to see how the freeKEY works after spilling a Margarita on it.

Continue reading Scosche freeKEY Bluetooth keyboard: flexible and splashproof

Scosche freeKEY Bluetooth keyboard: flexible and splashproof originally appeared on TUAW on Thu, 28 Apr 2011 16:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

iTunes 101: Making the most of contextual menus

I love contextual menus. In Mac OS X, you find them when you right-click, two-finger-click (on a trackpad) or when you hold down the Control key and click. They’re handy in scores of applications and in the Finder; if you’re looking to supercharge your iTunes usage in particular, Macworld’s Kirk McElhearn has published 10 ways to use contextual menus with iTunes.

One particularly useful option is to “Start Genius” from any track. When selected, iTunes will instantly create a genius playlist from that track. The “Add to playlist” option is also useful. When selected, you get a hierarchical menu all available playlists (smart playlists are excluded). Simply click the one you’re after and the track is added.

Contextual menus also work on multiple tracks at once. Make your selections by either Command- or Shift-clicking, then right-click one of the highlighted songs to see the contextual menu. From there you can add that group to a playlist, adjust ratings, convert tracks to Apple Lossless format, and so on.

Contextual Menu for iOS devicesThere’s an important iTunes contextual menu that didn’t make Macworld’s list. If you connect your iPhone, iPod touch or iPad to your computer, you can right-click the device’s icon in the iTunes sidebar to see a specific contextual menu for that iOS gadget. You can quickly eject, restore or back up your device; also, if you’re about to update your version of iOS but iTunes is warning you that you need to transfer purchased items from your device back to iTunes pre-update… well, here’s where you do it, via the Transfer Purchases command.

For all ten Macworld tips, read Kirk’s article. In the meantime, please share any favorites with us below.

iTunes 101: Making the most of contextual menus originally appeared on TUAW on Thu, 28 Apr 2011 15:15:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

Internet braces for royal wedding

Biz Stone prepares Twitter for royal wedding

As the bride climbs into her dress, the groom adjusts his cufflinks, the 1,900 invited guests arrive, and chefs make final preparations for the festivities to follow the ceremony, popular websites like YouTube, Flickr, Facebook and Twitter will be tuning their systems for a surge of wedding watchers.

In less than 24 hours, Prince William will marry Kate Middleton at Westminster Abbey in London, England. It’s the first British royal wedding in the age of the modern internet, and the monarchy promises to make it an internet-friendly event. Tomorrow’s celebration will be streamed live via YouTube, and the official royal-wedding website will post status updates to Twitter and Facebook; so will about 400 million of the royal family’s biggest fans, according to a report from the Wall Street Journal.

The anticipated increase in online traffic for tomorrow’s royal wedding could bring the internet to a frustratingly slow crawl and may topple some of the web’s premier destinations. Matt Graves, a spokesman for Twitter.com, said his site is ready for the deluge of wow-look-at-that-dress tweets that will inevitably arrive as Kate walks down the aisle.

As seen above, Twitter posted a photo of its co-founder, Biz Stone, mounting a single Xserve labelled “Wills & Kate” in preparation for the big event. The picture prompted the not-actually-official TwitterGlobalPR account to snipe, “Rumours of Twitter needing extra servers for the Royal Wedding are greatly exaggerated. We only need one.” Of course, the photo is intended as a joke — everyone knows Twitter’s infrastructure runs on the Mac mini.

Historically, major news and events have caused trouble for popular websites. Twitter, for example, displayed a boatload of fail whales after Michael Jackson died in 2009 and during the World Cup and Wimbledon in 2010. The simultaneous sporting tournaments generated the highest traffic in the internet’s history when over 10 million links were clicked per minute, according to Akamai.

Will the internet survive Prince William and Kate Middleton’s big day? We’ll all find out at 11:00 am London time on Friday, April 29.

Internet braces for royal wedding originally appeared on TUAW on Thu, 28 Apr 2011 14:47:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

New Wired for iPad issue out now, Adobe’s picking up the tab

Want to try out Wired Magazine for iPad, but you’re not too thrilled about paying US$3.99 for the latest issue? In an attempt to encourage potential subscribers to push the buy button in the future, and to show off some new features in the app, Wired 19.05 (otherwise known as the May 2011 edition) is being offered for free. To get the free issue, simply download the free app and visit the Wired Library once you’ve launched it. You’ll see an issue at the top marked Free Download, and with a tap you can download the 380 MB file.

Conde Nast, publisher of Wired, isn’t going to lose money on this proposition. Adobe has sponsored the issue, much like how Lincoln has paid for up to 200,000 passes for The New York Times paywall.

As usual, the magazine is chock-a-block with ads, but many of the ads in this issue are showing Wired’s commitment to making advertising both more interactive and more social. The interactive ads range from one that has you search for four Lexus hybrids to a rather boring Ameritrade ad that plays a teaser for an iPad app when touched. In some ads, you can brag about your achievement by tweeting friends or updating Facebook.

There’s also animated content; in a one page article titled “Why Soda Goes Pop,” the equation for Henry’s Law appears in animated carbon dioxide bubbles. There’s a video about lawn darts, and in an article about earbuds, a small info pop-up appears when you tap on each brand of bud.

I actually found most of the ads to be more compelling than the content in this issue, which is why I haven’t had a subscription to Wired since the late 1990s. Playing “Where’s Waldo?” in ads is more interesting than the “Pat the Bunny” type of interactive content that the magazine seems to be dredging up.

However, it’s worth the time and bandwidth to give the Wired for iPad app a look while it’s still available for free. The app is currently getting awful reviews in the App Store for losing previous issue purchases that readers had made, but if you’ve never bought an issue before, you’ll be safe. Be sure to check out the gallery below for some screenshots of some of the content and ads.

New Wired for iPad issue out now, Adobe’s picking up the tab originally appeared on TUAW on Thu, 28 Apr 2011 14:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments

SnuggleTruck: Rejected app goes cuddly for Apple approval

Imagine you’re an iOS game developer, and your new app’s theme focuses on smuggling illegal immigrants over the border. It offers a politically charged satiric scenario, one that could possibly offend customers. Apple reviewers consider the game, but they determine that it fails the smell test. Too tasteless — not gonna make it into the App Store. What do you do?

If you’re Owlchemy Labs, what you do is this: you redesign your somewhat edgy software to provide exactly the same gameplay, but change the artwork and sounds to provide an even more ironic take on the original.

Owlchemy substituted happy zoo animals for the original illegal immigrants. The cuddly creatures “escape from the wilderness for the comfort of a zoo, where they are provided with plenty of food, shelter and state-of-the-art healthcare.” Basically, Apple’s rejection allowed Owlchemy Labs to provide another layer of metatextual satire on top of the original satiric content.

The mind boggles.

Nevertheless, Apple happily approved this extremely subversive software now that people had to think before becoming offended. The original SmuggleTruck software is available for sale on both Mac and Windows, and it offers the new SnuggleTruck mode as a built-in extra.

SnuggleTruck is now available for sale on iTunes for US$1.99 for the iPhone version and $2.99 for the iPad HD version.

A video from the developers that explains the redesign follows after the break.

[via Joystiq]

Continue reading SnuggleTruck: Rejected app goes cuddly for Apple approval

SnuggleTruck: Rejected app goes cuddly for Apple approval originally appeared on TUAW on Thu, 28 Apr 2011 13:00:00 EST. Please see our terms for use of feeds.

Source | Permalink | Email this | Comments