Design Patterns

April 13, 2010 Leave a comment

Design Patterns

  • Delegation
  • Model View Controller
  • Target-Action

Delegation

Delegation is a pattern where one object periodically sends messages to another object specified as its delegate to ask for input or to notify the delegate that an event is occurring. You use it as an alternative to class inheritance for extending the functionality of reusable objects.

In this application, the application object tells its delegate that the main start-up routines have finished and that the custom configuration can begin. For this application, you want the delegate to create an instance of a controller to set up and manage the view. In addition, the text field will tell its delegate (which in this case will be the same controller) when the user has tapped the Return key.

Delegate methods are typically grouped together into a protocol. A protocol is basically just a list of methods. If a class conforms to a protocol, it guarantees that it implements the required methods of a protocol. (Protocols may also include optional methods.) The delegate protocol specifies all the messages an object might send to its delegate. To learn more about protocols and the role they play in Objective-C, see the “Protocols” chapter in The Objective-C Programming Language.

Model-View-Controller

The Model-View-Controller (MVC) design pattern assigns objects in an application one of three roles: model, view, or controller. The pattern defines not only the roles objects play in the application, it defines the way objects communicate with each other. Each of the three types of objects is separated from the others by abstract boundaries and communicates with objects of the other types across those boundaries. The collection of objects of a certain MVC type in an application is sometimes referred to as a layer—for example, model layer.

MVC is central to a good design for a Cocoa application. The benefits of adopting this pattern are numerous. Many objects in these applications tend to be more reusable, and their interfaces tend to be better defined. Applications having an MVC design are also more easily extensible than other applications. Moreover, many Cocoa technologies and architectures are based on MVC and require that your custom objects play one of the MVC roles.

Model-View-Controller design pattern

Model Objects

Model objects encapsulate the data specific to an application and define the logic and computation that manipulate and process that data. For example, a model object might represent a character in a game or a contact in an address book. A model object can have to-one and to-many relationships with other model objects, and so sometimes the model layer of an application effectively is one or more object graphs. Much of the data that is part of the persistent state of the application (whether that persistent state is stored in files or databases) should reside in the model objects after the data is loaded into the application. Because model objects represent knowledge and expertise related to a specific problem domain, they can be reused in similar problem domains. Ideally, a model object should have no explicit connection to the view objects that present its data and allow users to edit that data—it should not be concerned with user-interface and presentation issues.

Communication: User actions in the view layer that create or modify data are communicated through a controller object and result in the creation or updating of a model object. When a model object changes (for example, new data is received over a network connection), it notifies a controller object, which updates the appropriate view objects.

View Objects

A view object is an object in an application that users can see. A view object knows how to draw itself and can respond to user actions. A major purpose of view objects is to display data from the application’s model objects and to enable the editing of that data. Despite this, view objects are typically decoupled from model objects in an MVC application.

Because you typically reuse and reconfigure them, view objects provide consistency between applications. Both the UIKit and AppKit frameworks provide collections of view classes, and Interface Builder offers dozens of view objects in its Library.

Communication: View objects learn about changes in model data through the application’s controller objects and communicate user-initiated changes—for example, text entered in a text field—through controller objects to an application’s model objects.

Controller Objects

A controller object acts as an intermediary between one or more of an application’s view objects and one or more of its model objects. Controller objects are thus a conduit through which view objects learn about changes in model objects and vice versa. Controller objects can also perform setup and coordinating tasks for an application and manage the life cycles of other objects.

Communication: A controller object interprets user actions made in view objects and communicates new or changed data to the model layer. When model objects change, a controller object communicates that new model data to the view objects so that they can display it.

Target-Action

The target-action mechanism enables a view object that presents a control—that is, an object such as a button or slider—in response to a user event (such as a click or a tap) to send a message (the action) to another object (the target) that can interpret the message and handle it as an application-specific instruction.

In this application, when it’s tapped, the button tells the controller to update its model and view based on the user’s input.

Categories: Uncategorized Tags:

Memory management

April 13, 2010 Leave a comment

Memory management

Memory management is the programming discipline of managing the life cycles of objects and freeing them when they are no longer needed. Managing object memory is a matter of performance; if an application doesn’t free unneeded objects, its memory footprint grows and performance suffers. Memory management in a Cocoa application that doesn’t use garbage collection is based on a reference counting model. When you create or copy an object, its retain count is 1. Thereafter other objects may express an ownership interest in your object, which increments its retain count. The owners of an object may also relinquish their ownership interest in it, which decrements the retain count. When the retain count becomes zero, the object is deallocated (destroyed).

To assist you in memory management, Objective-C gives you methods and mechanisms that you must use in conformance with set of rules.

Note: In Mac OS X, you can either explicitly manage memory or use the garbage collection feature of Objective-C. Garbage collection is not available in iPhone OS.

Memory-Management Rules

Memory-management rules, sometimes referred to as the ownership policy, help you to explicitly manage memory in Objective-C code.

  • You own any object you create by allocating memory for it or copying it.

    Related methods: alloc, allocWithZone:, copy, copyWithZone:, mutableCopy, mutableCopyWithZone:

  • If you are not the creator of an object, but want to ensure it stays in memory for you to use, you can express an ownership interest in it.

    Related method: retain

  • If you own an object, either by creating it or expressing an ownership interest, you are responsible for releasing it when you no longer need it.

    Related methods: release, autorelease

  • Conversely, if you are not the creator of an object and have not expressed an ownership interest, you must not release it.

If you receive an object from elsewhere in your program, it is normally guaranteed to remain valid within the method or function it was received in. If you want it to remain valid beyond that scope, you should retain or copy it. If you try to release an object that has already been deallocated, your program crashes.

Aspects of Memory Management

The following concepts are essential to understanding and properly managing object memory:

  • Autorelease pools. Sending autorelease to an object marks the object for later release, which is useful when you want the released object to persist beyond the current scope. Autoreleasing an object puts it in an autorelease pool (an instance of NSAutoreleasePool), which is created for a arbitrary program scope. When program execution exits that scope, the objects in the pool are released.
  • Deallocation. When an object’s retain count drops to zero, the runtime calls the dealloc method of the object’s class just before it destroys the object. A class implements this method to free any resources the object holds, including objects pointed to by its instance variables.
  • Factory methods. Many framework classes define class methods that, as a convenience, create objects of the class for you. These returned objects are not guaranteed to be valid beyond the receiving method’s scope.

Delegation

April 13, 2010 Leave a comment

Delegation

Delegation is a simple and powerful pattern in which one object in a program acts on behalf of, or in coordination with, another object. The delegating object keeps a reference to the other object—the delegate—and at the appropriate time sends a message to it. The message informs the delegate of an event that the delegating object is about to handle or has just handled. The delegate may respond to the message by updating the appearance or state of itself or other objects in the application, and in some cases it can return a value that affects how an impending event is handled. The main value of delegation is that it allows you to easily customize the behavior of several objects in one central object.

Delegation and the Cocoa Frameworks

The delegating object is typically a framework object, and the delegate is typically a custom controller object. The delegating object holds a weak reference to its delegate. Examples of delegation abound in the Foundation, UIKit, AppKit, and other Cocoa and Cocoa Touch frameworks.

An example of a delegating object is an instance of the NSWindow class of the AppKit framework. NSWindow declares a protocol, among whose methods is windowShouldClose:. When a user clicks the close box in a window, the window object sends windowShouldClose: to its delegate to ask it to confirm the closure of the window. The delegate returns a Boolean value, thereby controlling the behavior of the window object.

Framework object sending a message to its delegate

Delegation and Notifications

The delegate of most Cocoa framework classes is automatically registered as an observer of notifications posted by the delegating object. The delegate need only implement a notification method declared by the framework class to receive a particular notification message. Following the example above, a window object posts an NSWindowWillCloseNotification to observers but sends a windowShouldClose: message to its delegate.

Data Source

A data source is almost identical to a delegate. The difference is in the relationship with the delegating object. Instead of being delegated control of the user interface, a data source is delegated control of data. The delegating object, typically a view object such as a table view, holds a reference to its data source and occasionally asks it for the data it should display. A data source, like a delegate, must adopt a protocol and implement at minimum the required methods of that protocol. Data sources are responsible for managing the memory of the model objects they give to the delegating view.

Categories: Iphone refernces Tags:

iPad prices in India may begin at Rs 23,000

Apple iPad, the latest tech device routed as that of the next generation gadget, will come to India in April 2010. According to Apple distributors in India, the Apple iPad will be available in India from April onwards.

iPad prices in India may begin at Rs 23,000

That is pretty fast, considering the normal delay for almost all cool gadgets to reach us in India. For example, we are yet to receive the Motorola Droid, or the Nokia N900, or the Nexus One. All of which us gadget freaks in India have to get our favourite gadgets from friends or relatives abroad, or browse the back alleys.

Photo: Apple iPad youtube appPhoto: Apple iPad youtube app

Even the Apple iPhone took ages to reach us here in India. Not so for the just-launched iPad.

Apple launched its much anticipated tech gadget, the Apple iPad, claiming to bridging the gap between smartphones and laptops. The 9.7-inch touch-screen tablet was launched in San Francisco by none other than Steve Jobs at a widely – and wildly – anticipated press event.

According to the distributors of Apple in India, the cost of the Apple iPad will be the same in India as that in the US. The lower-end 16GB model will be available for USD 500 (INR 23000) plus 16% VAT, thereby taking it to INR 27000. High end versions of the Apple iPad will sell for USD $599 (Rs28,000) and $699 (Rs32,500), excluding taxes.

The retail shops are expecting a nice time once the iPad is available in India, with many potential customers calling up the shops to inquire about the product.

According to sector experts, Apple has priced the iPad reasonably, considering the fact that the high price of Apple’s iPhone discouraged many potential buyers from buying the device. It seems like Apple has taken a cue from that experience and according to experts, the price tag of Apple iPad is only reasonable considering the volume of functionalities it incorporates.

The Apple iPad can be used to surf the net, check emails, play games or listen to music. It also comes with Wi-Fi and related applications. The most interesting thing about the iPad is its battery, which is capable of playback up to a cool 10 hours. It is clear that Apple is going after the ebook market so far ruled by the Amazon Kindle and Kindle DX e-readers.

Many however think that the Apple iPad was a disappointment, after all the hype about it being a potential saviour for the publishing industry. True, several book publishers have already signed up for the iBookstore app on the iPad. But there is precious little by way of newspapers and magazines on the iPad optimized for the new interface. That is something content creators will have to work on.

Major complaints about the iPad so far include its name (which remind many of a female hygiene product), the large bezel (which may be useful for holding it properly), the lack of a camera, the fact that it is running a version of the iPhone OS and not the OS X Snow Leopard, that it does not offer proper multitasking… and that there is no phone.

It is also thought that companies like Asus and MSI are in the works of producing a product of the same kind albeit additional features. Even HP has plans to launch a tablet computer – but unlike the iPad, the HP Slate will run a version of Windows 7.

keyboard shortcuts for Word 2002, Word 2003, and Word 2007

   Command Name                  Shortcut Keys
   ------------------------------------------------------------------------

   All Caps                      CTRL+SHIFT+A
   Annotation                    ALT+CTRL+M
   App Maximize                  ALT+F10
   App Restore                   ALT+F5
   Apply Heading1                ALT+CTRL+1
   Apply Heading2                ALT+CTRL+2
   Apply Heading3                ALT+CTRL+3
   Apply List Bullet             CTRL+SHIFT+L
   Auto Format                   ALT+CTRL+K
   Auto Text                     F3 or ALT+CTRL+V
   Bold                          CTRL+B or CTRL+SHIFT+B
   Bookmark                      CTRL+SHIFT+F5
   Browse Next                   CTRL+PAGE DOWN
   Browse Previous               CTRL+PAGE UP
   Browse Sel                    ALT+CTRL+HOME
   Cancel                        ESC
   Center Para                   CTRL+E
   Change Case                   SHIFT+F3
   Char Left                     LEFT
   Char Left Extend              SHIFT+LEFT
   Char Right                    RIGHT
   Char Right Extend             SHIFT+RIGHT
   Clear                         DELETE
   Close or Exit                 ALT+F4
   Close Pane                    ALT+SHIFT+C
   Column Break                  CTRL+SHIFT+ENTER
   Column Select                 CTRL+SHIFT+F8
   Copy                          CTRL+C or CTRL+INSERT
   Copy Format                   CTRL+SHIFT+C
   Copy Text                     SHIFT+F2
   Create Auto Text              ALT+F3
   Customize Add Menu            ALT+CTRL+=
   Customize Keyboard            ALT+CTRL+NUM +
   Customize Remove Menu         ALT+CTRL+-
   Cut                           CTRL+X or SHIFT+DELETE
   Date Field                    ALT+SHIFT+D
   Delete Back Word              CTRL+BACKSPACE
   Delete Word                   CTRL+DELETE
   Dictionary                    ALT+SHIFT+F7
   Do Field Click                ALT+SHIFT+F9
   Doc Close                     CTRL+W or CTRL+F4
   Doc Maximize                  CTRL+F10
   Doc Move                      CTRL+F7
   Doc Restore                   CTRL+F5
   Doc Size                      CTRL+F8
   Doc Split                     ALT+CTRL+S
   Double Underline              CTRL+SHIFT+D
   End of Column                 ALT+PAGE DOWN
   End of Column                 ALT+SHIFT+PAGE DOWN
   End of Doc Extend             CTRL+SHIFT+END
   End of Document               CTRL+END
   End of Line                   END
   End of Line Extend            SHIFT+END
   End of Row                    ALT+END
   End of Row                    ALT+SHIFT+END
   End of Window                 ALT+CTRL+PAGE DOWN
   End of Window Extend          ALT+CTRL+SHIFT+PAGE DOWN
   Endnote Now                   ALT+CTRL+D
   Extend Selection              F8
   Field Chars                   CTRL+F9
   Field Codes                   ALT+F9
   Find                          CTRL+F
   Font                          CTRL+D or CTRL+SHIFT+F
   Font Size Select              CTRL+SHIFT+P
   Footnote Now                  ALT+CTRL+F
   Go Back                       SHIFT+F5 or ALT+CTRL+Z
   Go To                         CTRL+G or F5
   Grow Font                     CTRL+SHIFT+.
   Grow Font One Point           CTRL+]
   Hanging Indent                CTRL+T
   Header Footer Link            ALT+SHIFT+R
   Help                          F1
   Hidden                        CTRL+SHIFT+H
   Hyperlink                     CTRL+K
   Indent                        CTRL+M
   Italic                        CTRL+I or CTRL+SHIFT+I
   Justify Para                  CTRL+J
   Left Para                     CTRL+L
   Line Down                     DOWN
   Line Down Extend              SHIFT+DOWN
   Line Up                       UP
   Line Up Extend                SHIFT+UP
   List Num Field                ALT+CTRL+L
   Lock Fields                   CTRL+3 or CTRL+F11
   Macro                         ALT+F8
   Mail Merge Check              ALT+SHIFT+K
   Mail Merge Edit Data Source   ALT+SHIFT+E 
   Mail Merge to Doc             ALT+SHIFT+N
   Mail Merge to Printer         ALT+SHIFT+M
   Mark Citation                 ALT+SHIFT+I
   Mark Index Entry              ALT+SHIFT+X
   Mark Table of Contents Entry  ALT+SHIFT+O
   Menu Mode                     F10
   Merge Field                   ALT+SHIFT+F
   Microsoft Script Editor       ALT+SHIFT+F11
   Microsoft System Info         ALT+CTRL+F1
   Move Text                     F2
   New                           CTRL+N
   Next Cell                     TAB
   Next Field                    F11 or ALT+F1
   Next Misspelling              ALT+F7
   Next Object                   ALT+DOWN
   Next Window                   CTRL+F6 or ALT+F6
   Normal                        ALT+CTRL+N
   Normal Style                  CTRL+SHIFT+N or ALT+SHIFT+CLEAR (NUM 5)
   Open                          CTRL+O or CTRL+F12 or ALT+CTRL+F2
   Open or Close Up Para         CTRL+0
   Other Pane                    F6 or SHIFT+F6
   Outline                       ALT+CTRL+O
   Outline Collapse              ALT+SHIFT+- or ALT+SHIFT+NUM -
   Outline Demote                ALT+SHIFT+RIGHT
   Outline Expand                ALT+SHIFT+=
   Outline Expand                ALT+SHIFT+NUM +
   Outline Move Down             ALT+SHIFT+DOWN
   Outline Move Up               ALT+SHIFT+UP
   Outline Promote               ALT+SHIFT+LEFT
   Outline Show First Line       ALT+SHIFT+L
   Overtype                      INSERT
   Page                          ALT+CTRL+P
   Page Break                    CTRL+ENTER
   Page Down                     PAGE DOWN
   Page Down Extend              SHIFT+PAGE DOWN
   Page Field                    ALT+SHIFT+P
   Page Up                       PAGE UP
   Page Up Extend                SHIFT+PAGE UP
   Para Down                     CTRL+DOWN
   Para Down Extend              CTRL+SHIFT+DOWN
   Para Up                       CTRL+UP
   Para Up Extend                CTRL+SHIFT+UP
   Paste                         CTRL+V or SHIFT+INSERT
   Paste Format                  CTRL+SHIFT+V
   Prev Cell                     SHIFT+TAB
   Prev Field                    SHIFT+F11 or ALT+SHIFT+F1
   Prev Object                   ALT+UP
   Prev Window                   CTRL+SHIFT+F6 or ALT+SHIFT+F6
   Print                         CTRL+P or CTRL+SHIFT+F12
   Print Preview                 CTRL+F2 or ALT+CTRL+I
   Proofing                      F7
   Redo                          ALT+SHIFT+BACKSPACE
   Redo or Repeat                CTRL+Y or F4 or ALT+ENTER
   Repeat Find                   SHIFT+F4 or ALT+CTRL+Y
   Replace                       CTRL+H
   Reset Char                    CTRL+SPACE or CTRL+SHIFT+Z
   Reset Para                    CTRL+Q
   Revision Marks Toggle         CTRL+SHIFT+E
   Right Para                    CTRL+R
   Save                          CTRL+S or SHIFT+F12 or ALT+SHIFT+F2
   Save As                       F12
   Select All                    CTRL+A or CTRL+CLEAR (NUM 5) or CTRL+NUM 5
   Select Table                  ALT+CLEAR (NUM 5)
   Show All                      CTRL+SHIFT+8
   Show All Headings             ALT+SHIFT+A
   Show Heading1                 ALT+SHIFT+1
   Show Heading2                 ALT+SHIFT+2
   Show Heading3                 ALT+SHIFT+3
   Show Heading4                 ALT+SHIFT+4
   Show Heading5                 ALT+SHIFT+5
   Show Heading6                 ALT+SHIFT+6
   Show Heading7                 ALT+SHIFT+7
   Show Heading8                 ALT+SHIFT+8
   Show Heading9                 ALT+SHIFT+9
   Shrink Font                   CTRL+SHIFT+,
   Shrink Font One Point         CTRL+[
   Small Caps                    CTRL+SHIFT+K
   Space Para1                   CTRL+1
   Space Para15                  CTRL+5
   Space Para2                   CTRL+2
   Spike                         CTRL+SHIFT+F3 or CTRL+F3
   Start of Column               ALT+PAGE UP
   Start of Column               ALT+SHIFT+PAGE UP
   Start of Doc Extend           CTRL+SHIFT+HOME
   Start of Document             CTRL+HOME
   Start of Line                 HOME
   Start of Line Extend          SHIFT+HOME
   Start of Row                  ALT+HOME
   Start of Row                  ALT+SHIFT+HOME
   Start of Window               ALT+CTRL+PAGE UP
   Start of Window Extend        ALT+CTRL+SHIFT+PAGE UP
   Style                         CTRL+SHIFT+S
   Subscript                     CTRL+=
   Superscript                   CTRL+SHIFT+=
   Symbol Font                   CTRL+SHIFT+Q
   Thesaurus                     SHIFT+F7
   Time Field                    ALT+SHIFT+T
   Toggle Field Display          SHIFT+F9
   Toggle Master Subdocs         CTRL+\ 
   Tool                          SHIFT+F1
   Un Hang                       CTRL+SHIFT+T
   Un Indent                     CTRL+SHIFT+M
   Underline                     CTRL+U or CTRL+SHIFT+U
   Undo                          CTRL+Z or ALT+BACKSPACE
   Unlink Fields                 CTRL+6 or CTRL+SHIFT+F9
   Unlock Fields                 CTRL+4 or CTRL+SHIFT+F11
   Update Auto Format            ALT+CTRL+U
   Update Fields                 F9 or ALT+SHIFT+U
   Update Source                 CTRL+SHIFT+F7
   VBCode                        ALT+F11
   Web Go Back                   ALT+LEFT
   Web Go Forward                ALT+RIGHT
   Word Left                     CTRL+LEFT
   Word Left Extend              CTRL+SHIFT+LEFT
   Word Right                    CTRL+RIGHT
   Word Right Extend             CTRL+SHIFT+RIGHT
   Word Underline                CTRL+SHIFT+W

Apple script – Javascripting webkit thru AppleScript

tell application "Safari" to do JavaScript "alert('Hello, world!')" 
in document 1

Apple latest creation Events

11:33AM That’s it. Time for a hands-on!
11:33AM “We’ve always tried to be at the intersection of technology and liberal arts — we want to make the best tech, but have them be intuitive. It’s the combination of these two things that have let us make the iPad.”
11:32AM “This is a magical device, at a breakthrough price.”
11:31AM “We think we’ve got the goods. We think we’ve done it. Another thing we’re excited about is that there’s already 75m people who know how to use this because of how many iPhones and iPod touches we’ve shipped.”
11:30AM “Do we have what it takes to establish a third category of products?”
11:30AM Steve is back!
11:29AM Okay, finally some casual typing shown! On the lap folks.
11:27AM “The iPad is the most advanced piece of tech that I’ve ever worked on at Apple.”
11:26AM No phone calls from what we can tell.
11:26AM So to recap. No multitasking. No word on notifications.
11:22AM Jonny Ive talking about magical devices. “That’s exactly what the iPad is.” Magical? Really? Doesn’t seem that magical to us!
11:22AM “Now we made a video we’re going to put on the web… let’s run it here.”
11:22AM Third… a case.
11:21AM “We’ve got some really great accessories. First one is a dock. You know the slideshow I showed you? When it’s in the dock you have a great picture frame. We have another dock that’s interesting… the keyboard dock.” What!?
11:20AM “We will be shipping these in 60 days. 3G models will ship in 90 days.”
11:20AM “So $499 for 16GB of iPad. That’s our base model. 32GB is $599, 64GB is $799. 3G models cost an extra $130. $629, 729, and 829 with 3G.”
11:18AM “And just like we were able to meet or exceed our tech goals, we have met our cost goals… iPad pricing starts at $499.”
11:18AM “If you listen to the pundits, we’re going to price it under $1000, which is code for $999. When we set out to develop this, we had ambitious tech goals, but we had aggressive price goals.”
11:17AM “What should we price it at?”
11:17AM “And the new iBooks application. You can carry literally thousands of books around. And the iWork suite of apps with the best UI we’ve ever seen for something like this.”
11:17AM “WiFI plus 3G if you want it. So iPad. It’s phenomenal. Email is fantastic, best device for photos, great for music, great for video. It runs almost all of the 140k apps on the app store, as well as a whole new generation of apps.”
11:16AM “So we have a breakthrough deal in the US. We hope to have our international deals in the June / July timeframe. However, all of the iPad 3G models are unlocked, and they use the new GSM microSIMs.”
11:15AM “So how do you turn this on and manage it? You can activate this right on the iPad. And there’s no contract — it’s prepaid.”
11:14AM “We have a breakthrough deal with AT&T.” Wow. Some serious sharp intakes of breath here.
11:14AM “We have an unlimited plan for just $29.99 a month.”
11:14AM “Now what does it cost for the data plans? Well in the US carriers charge about $60 a month. We have a real breakthrough. Two awesome plans for iPad owners. The first one gives you 250MB of data a month for $14.99.”
11:13AM “Now I’d like to talk about wireless networking. Every iPad has WiFi… but we’re also going to have models with 3G.”
11:12AM “Isn’t it great?” Some slight hesitation. “A few other things. I’d like to talk for a minute about iTunes. The iPad syncs over USB just like an iPhone or iPod.”
11:11AM “That’s iWork on the iPad.” And Steve is… back!
11:11AM And the iWork demo is done. “So what are we going to charge for applications like this? We’re gong to charge just $9.99 each.” He means $10 for Pages, $10 for Keynote… etc.
11:10AM It looks as though these new dropdowns menus are a major part of the iPad OS. Will be interesting to see how this translates to the iPhone and iPod touch. Is there going to be room? Or will they be left out entirely?
11:09AM Interesting. A data entry keyboard just for entering info into a spreadsheet. There are a number of different keyboard for specific tasks, also a date and time keyboard.
11:06AM New tool: Page Navigator. It’s a bit like the magnification loop and lets you jump through pages. Automatic image outlines — just drag your image and text reformats.
11:05AM “Like Keynote I see a gallery of documents.”
11:05AM Automatic transition animations. Very nice. “So that’s a preview. Now let’s go to Pages.”
11:03AM We’ll say this — iWork looks really robust. Far more than an iPhone app. Lots of options, lots of ways to work with your data.
11:02AM They’ve really redone this interface. We don’t know about you, but using iWork wasn’t one of our fantasies when we thought about what an Apple tablet would be like. This is nice… but it’s iWork.
11:00AM Phil is showing off spreadsheets “It’s cool and easy to use.”
11:00AM Phil is out. “Good morning everyone. iWork is a suite of apps that millions of customers love.”
10:59AM “Could the tablet handle that? You betcha. But they required a new UI — here’s Phil Schiller to tell you about it.”
10:58AM “Now, something very exciting… iWork. A little over a year ago I asked the head of our team about creating iWork for the iPad. The reaction was… ‘ahhh they require a lot of horsepower'”
10:57AM “So iBooks again, a great reader, a great online bookstore. All in one really great app. We use the ePub format. We’re very excited about this.”
10:57AM “You can change the font… whatever you want. And that is iBooks.”
10:56AM The store is very similar to iTunes. Same modal pop-overs. Pricing doesn’t look too bad. The book page display is nice. You can turn pages slowly — really slick looking page animation.
10:55AM Demo time. Steve is showing it off.
10:54AM Five big partners… Penguin, Macmillion, Simon & Shuster… and more.
10:54AM “It has a bookshelf. In addition there’s a button which is the store — we’ve created the new iBook Store. You can download right onto your iPad.”
10:53AM “Isn’t that awesome? These guys only had two weeks. So we’ve seen some really great apps. Let me show you another… one of our apps. That’s an ebook reader. Now Amazon has done a great job of pioneering this… we’re going to stand on their shoulders for this. Our new app is called iBooks.”
10:52AM Scott: “While we wait for those apps to come out, we can all run our existing apps… and that is the app story for the iPad.” And Steve is back.
10:51AM Nice, live video within the app. Full screen too.
10:50AM Chad Evans from MLB.com — “We were excited to build something for the iPad. We had to create a whole new experience for this display.”
10:49AM Finally, MLB.com…
10:49AM And that’s it for EA. Really?
10:49AM A handful of new touch controls. Graphics look smooth, fairly fast.
10:48AM Need for Speed Shift on screen. Looks pretty good. “Building for the iPad is a little different — it’s kind of like holding an HD display up to your face. It’s really cool.”
10:47AM Travis Boatman from EA is up. “When Apple invited us to come on site, we couldn’t have been more excited. But we wanted to check out this device’s performance as gamers.”
10:46AM “Next up, EA.” Of course!
10:46AM Scott is… back.
10:46AM This is very slick — probably the most impressive demo yet. A very sophisticated use of the screen real estate. Brushes for the iPad looks like you can go pretty deep. Available at product launch.
10:45AM “Today I’d like to show you how brushes looks on the iPad.” This is nice. Context menus for brush and color options. We’re loving these new pop-over menus. No more diving!
10:44AM “Next is Brushes. It’s an extremely popular app.” Steve Sprang from Brushes is up.
10:43AM And Scott is back! That was brief.
10:43AM “This is just the beginning.” Big cheers.
10:42AM Wow, nice. Embedded video inside of articles that can be played.
10:42AM “We think we’ve captured the essence of reading the newspaper. A superior experience in a native application.” Wow, the layout is just like a standard paper, and again we’ve got those dropdown context menus. You can resize text with a pinch.
10:41AM “So Steve showed you the Times website, it’s beautiful. Why did we come out here to develop a new app for the iPad? Our iPhone app has been downloaded 3m times. We wanted to create something special for the iPad.”
10:40AM “To tell you about their plans for the iPad — Martin Nisenholtz.”
10:40AM “The iPad version of Nova ships later this year…” Interesting. Scott is back. “Next up, the New York Times.”
10:39AM Showing off their FPS Nova. “I can slide the d-pad on the screen…” You can set up your own controls. New gestures for interacting with games. This isn’t anything breathtaking just yet — fairly standard graphics (though nice), nothing new in terms of interaction.
10:37AM “We’re exciting about possibilities on this. So we invited some developers two weeks ago to see what they could create. We want to show you what they came up with. First, Gameloft.” Mark Hickey from Gameloft is up.
10:36AM “We’re going to feature iPad apps front and center for you.”
10:36AM “We think it’s going to be another gold rush for devs. And of course every iPad comes with the app store on it.”
10:36AM “We rewrote all of our apps for this display. the iPhone SDK supports development for this now… and we’re releasing it today.”
10:35AM “So all of the iPhone apps will run on this. In fact when you buy it, download all the apps you have right onto the iPad. Now if the developer spends some time modifying their app, they can take full advantage of this display.”
10:34AM Games look amazing. He’s playing an OpenGLS title right now and it looks super smooth.
10:34AM So far no word on multitasking, but we haven’t seen it. Jumps into and out of apps, nothing running concurrently.
10:33AM Gaming obviously will handle this better, but a text heavy app looks lonely or weirdly huge.
10:33AM “Let’s start with Facebook. It just works.” He’s showing off the non-pixel doubled version, a small app in the middle of the screen. It’s kind of silly looking. A lone app in the center of a black screen. The scaled up app looks silly as well, especially in Facebook.
10:32AM “We can also pixel double and run the apps full screen.”
10:31AM Can run all iPhone apps unmodified out of the box.
10:31AM “Morning. The app store has been a huge success. Already our customers have downloaded 3b apps.”
10:31AM “Now, let’s go back to software. We’ve seen some great built in apps. Let’s talk about third party. Let’s talk about the app store.” Scott Forstall is out!
10:30AM “What is the battery life like? We’ve been able to achieve 10 hours of battery life. I can take a flight from San Francisco to Tokyo and watch video the whole time. And it has over a month of standby time.”
10:29AM Available in 16GB, 32, 64…
10:29AM “It’s powered by our own silicon. The 1GHz Apple A4 chip. It screams.”
10:28AM Full capacitive multitouch
10:28AM “Let’s go back to the hardware.” .5 inches thin, 1.5 pounds — 9.7 inch IPS display
10:27AM Big cheers. “Watching it is nothing like getting it in your hands.”
10:27AM “So that is video on the iPad. It gives you an overview of what the iPad can do.”
10:26AM Now we’re watching a clip of Star Trek. Looks great.
10:25AM “It just all works. And of course videos… we’ve got movies, TV shows, music videos.”
10:25AM “Let’s go to YouTube. I know this clip is in HD. I can go full screen.”
10:24AM Steve is in Maps now. Zooming looks super fast — no idea what this chip is, but it has no trouble handling pretty graphically intense stuff. Everything looks polished — zero hiccup. “Now here’s street view…” Wow. Big applause for that. “Now let me show you video.”
10:23AM Now he’s showing off calendar. Some new looks here.
10:22AM “Let me show you a few other things. The iTunes store is built right in. I can sample music, buy songs.” The interface has modals that pop over what you’re viewing to show you song / album info.
10:22AM Steve is playing more Dylan!
10:21AM Wow, iTunes interface is really nice, very expansive.
10:21AM This is the ultimate tease. We’ve got a sneaking suspicion there’s a lot more to come.
10:21AM “You get the idea.” Applause.
10:20AM Now we’re watching a photo slideshow… just like iPhoto, cute music and all.
10:20AM Places in the photo app, that is.
10:20AM Now Steve is flipping through photos. Places is up now — Google Maps in effect!
10:19AM “If I’m on a Mac, I can get events, places, and faces from iPhoto here.”
10:18AM “Next, photos… this is what photos looks like. I can look at everything as a list of photos. I can tap on it…” Flicks and gestures just like the iPhone.
10:18AM “Now if I want to send a message, I hit compose — up pops this gorgeous keyboard.” Steve is typing, it looks very responsive.
10:17AM Wow, nice email display — message list in a column on the left, full message on the right.
10:17AM “So that’s browsing the web. Let’s go to email.” Again, menus pop down from the top.
10:16AM We’re basically just watching Steve casually browse. This is odd.
10:16AM Now Steve is on Fandango… Now National Geographic. Switching to landscape. If you’re an iPhone owner this will seem very familiar.
10:15AM “Let’s go to Time magazine… see what’s up there.”
10:15AM No flash here… the missing plugin icon is on screen.
10:14AM It’s essentially a huge Mobile Safari — looks really really slick.
10:14AM Wow, super smooth scrolling.
10:14AM Slide to unlock screen just like the iPhone. “This is the lock screen — icons fly in. Let’s go right to the web…” Apple.com — Bookmarks drop down from a bunch of contextual menus up top.
10:13AM “And it’s awesome to watch movies and TVs… let’s take a look at the device.” Demo time!
10:13AM “We have the iTunes store built right in. YouTube, and YouTube in HD.”
10:12AM The leak was real! Same maps application!
10:12AM “Album, photos… you can look at all of them, flick through them, it’s a wonderful way to share. Calendar… months…” The interface really does look like an exploded iPhone.
10:12AM “Phenomenal for mail.” Wow, new drop downs in the mail interface… and a large onscreen QWERTY!
10:11AM “Way better than a laptop, way better then a phone. You can turn it any way you want. To see the whole page is phenomenal.”
10:11AM “So, gonna give you a little overview. It’s very thin — you can change the homescreen to whatever you want. What this device does is extraordinary. You can browse the web with it. It’s the best web experience you’ve ever had.”
10:10AM “Let me show it to you now.” Wow — looks like our leak!
10:10AM “We think we’ve got something that is better. And we call it the iPad.”
10:09AM “Now some people thought that was a netbook — the problem is that netbooks aren’t better than anything!” Big cheers! Ha!
10:09AM “If there’s gonna be a third category, it has to be better at these tasks — otherwise it has no reason for being.”
10:09AM “What kind of tasks? Browsing the web. Doing email. Enjoying and sharing pics. Watching videos. Enjoying music. Playing games. Reading ebooks.”
10:08AM “SO all of us use laptops and smartphones… the question has arisen; is there room for something in the middle. We’ve wondered for years as well — in order to create that category, they have to be far better at doing some key tasks… better than the laptop, better than the smartphone.”
10:07AM “Let’s go back to 1991, when we first shipped our Powerbooks. The first with a TFT screen, the first with palm rests, and had an integrated pointing device. Just a few years ago in 2007 we reinvented the phone… and a few years later we got the iPhone 3GS.”
10:07AM “So let’s get to the main event.”
10:06AM “So those are the updates that we have today.”
10:06AM “And by revenue… it’s even bigger than Nokia.”
10:06AM “Now where do we get this revenue? iPods, iPhones, and Macs. What’s interesting is that iPods are mobile devices, the iPhone is, and most of our computers. We’re a mobile company. That’s what we do. How do we stack up against all the other companies that sell mobile devices? We’re the largest mobile device company in the world. Larger than Sony, bigger than Samsung….”
10:05AM “Lastly – we started Apple in 1976 – 34 years later we just ended our holiday quarter with 50.6b dollars of revenue…” He showed a pic of him and Woz!
10:04AM “Next update – the app store. We have over 140k apps, and a few weeks ago we announced a user downloaded 3b apps.”
10:03AM Now Steve is talking about the new Apple store in NYC. “Here it is on opening day. It’s so wonderful to put these stores in the neighborhoods with our customers.”
10:03AM “But first I have a few updates. A few weeks ago we sold our 250mth iPod. The second update is about our stores – we now have 284. It’s amazing. Last quarter we had 50m visitors.”
10:02AM “We want to kick of 2010 by introducing a magical and revolutionary product today… but first I have a few updates.”
10:01AM Steve is soaking it in. “Good morning and thank you all for coming.”
10:01AM And Steve is out! Huge applause… and a standing ovation from some audience members.
10:00AM The lights are going down… here we go!
10:00AM Verizon and Sprint 3G cards are your good, good buddies at an Apple event.
9:56AM “Please silence your phones… our program will begin shortly.” Oooh.
9:55AM Sitting next Jim Dalrymple from The Loop… who’s currently dealing with the aforementioned WiFi issues.
9:54AM Everyone is really all smiles here. Sure, the WiFi just went out, but generally everyone seems to be quite excited. Makes sense, gadgets and money will be flowing like sweet summer wine when this thing is all over. Right?
9:51AM The electric version of ‘Baby Let Me Follow You Down’ – in case you were wondering.
9:50AM So, more Dylan. We swear, if Bob Dylan shows up at this event, we’re going to seriously freak out. In a good way.
9:43AM The setup on stage is really interesting. There’s a chair with a table next to it… very unusual for an Apple event.
9:42AM Okay! We’re in our seats and there’s some Dylan playing on the sound system!
9:11AM Overall the mood is really jovial right now. It’s basically a party in the U.S.A.
9:09AM We’re in line waiting to get inside. People are seriously crowding. Let’s hope we don’t get trampled!

Will the Apple tablet finally, really be unveiled? We’re at the Yerba Buena Center in San Francisco (see above) patiently waiting to get inside and get this thing underway! Keep reading after the break for the minute by minute coverage!

Applescript&shell programming

 

Change your icons for mac

Home folder foldersYou can copy practically any item’s icon and paste it onto another to change the look of your
volumes, files, folders, and applications. We customized our Home folder’s folders.

Application icons are all generally unique, so they stand out from one another. Folder icons may flaunt a plain blue folder facade or display a little extra decor on the folder icons to help you identify what’s inside of them. File icons generally display a document with an application logo that lets you know what application created it or can open it. But you can change these mini works of art to ones of your own choosing or creation.

To change an item’s icon to another one:

  1. Select the volume, application, folder, or file whose icon you want to stamp onto another, just click the icon to select it.
  2. From the File menu, choose Get Info or press Command-I to open the Info window.
  3. Click the icon in the upper-left corner of the Info window to select it.
  4. From the Edit menu, choose Copy or press Command-C.
  5. Select the volume, application, folder, or file whose icon you want to replace.
  6. From the File menu, choose Get Info or press Command-I.
  7. Click the icon in the upper-left corner.
  8. From the Edit menu, choose Paste or press Command-V to replace the icon.

Change your user account icon

Your user account bears an image icon that appears when you log in, (if your Mac isn’t set to automatically log you in), as your default icon in iChat, and in your Address Book card. When you first set up your Mac, you had the opportunity to select a picture to use as your icon. If you’re looking for a change, here’s how to select a different image.

select a picture for your iconIn Accounts Preferences, you can use one of the pictures that Apple provides
for your user icon, or make your own from an image.

  1. Make sure that you’re logged in to the user account whose picture you want to change. From the Apple menu, choose System Preferences.
  2. Click Accounts.
  3. Click the Picture tab.
  4. Click Edit.
  5. Drag any image file from your desktop or a Finder window onto the resulting Images window.
  6. Use the slider at the bottom of the window to zoom in to your picture. You can also drag the image around in the window to adjust the framing.
  7. When satisfied, click Set to make the change.

Get icons

If you’re interested in finding more icons than what’s currently in your Mac, you can find plenty of third-party Mac icon creators on the web who make their designs available for download. If one suits your fancy, just copy and paste the icon as we showed you above. Here are a few third-party icon websites:

Categories: mac Tags:

How to Make a DMG File on a Mac

March 25, 2010 Leave a comment
  1. Create a New Folder and place the files you would like in your disk image into this new folder.
  2. Right click (or CTRL-Click) the folder and select “Get Info” and note the size of its contents.
  3. Open Disk Utility (Applications > Utilities > Disk Utility)
  4. Click the “New Image” icon to create a new disk image. Enter a name for the Image, and select a size adequate for the size of your folder you created in Step 2. Set the encryption to “none” and Format to “read/write disk image.” or “DVD/CD Master.” See Tips to learn how to encrypt the image.
  5. Place the contents of the folder from Step 2 into the newly mounted disk image.
  6. Unmount the Disk Image by dragging its icon to the Trash. In the Finder window, you can also click the Eject symbol next to the mounted image.