Fast Lookup directory for MAC Development

Source: Internet
Author: User
Tags dashed line

The following goes from "Leopard easy programming: saving You Code"

Directory:

-Core Animation Animation

-View Description

-and quick View work together

-Manage multiple views (for custom pagination controls, etc.)

-Images or views are rendered in an iphoto form of an animated table

-Set up your own smart groups, playlists, directories

-Add Custom views to the menu

-Menu Enhancements

-Print Interface

-Global Type Flags

-Use a column view like a mail program

-Display the document icon within the title bar

-HUD window similar to iphoto toolbar

-Controls the material and metal form of the window and controls the position of the painting

-Spaces Integration

-"Don't remind me Again"

-Dock icons for different windows and programs, including badges and numbers

-Accurate mouse tracking

-More Text formats

-Layout Manager Enhancements

-Safari 3 Style search results

-automatic linking, referencing and built-in picture editing

-Spell Check

-Remove unwanted images from the button

-Free images and icons

-Draw complex graphics by tiling small pictures

-Recessed form of box

-built-in support for color gradients

-Enhanced tableviews and Outlineviews

-Source List

-Path display in ITunes song store form

-built-in image editing

-built-in PDF viewing and browsing

-Uninstalling Packages

-Get memory and processor information

-Simpler order of precedence sequences

-Show Date

-String encoding

-More efficient expressions for Core data

-Scripting support

-Work together with ical and other data

-RSS Support

-Interface Builder

Matt Gemmell

Body:

As a developer of cocoa, the release of every new version of Mac OSX requires us to spend time familiarizing ourselves with the new APIs and mechanisms they provide. In this familiarity process, a major goal is to understand the new controls and features provided by the operating system. These features we can only use in the previous version of the Code to implement, and now the system itself provides the corresponding calling interface.

In the past few months, I have been using leopard. I think I should list some of the new Api,cocoa application developers who will be interested in them. I will introduce them in categories, and they will be accompanied by some. You can add the new features you find in the message. I'll introduce them in the order they are published in the AppKit and fundation release notes, and if you really want to focus on the new features of leopard, we recommend that you also review these release notes.

Naturally, these new APIs do have some problems with previous versions of support, but this does not affect the practical value of these new features.

Core Animation Animation

This is something that needs to be introduced. If you spend some time reading a document, paying particular attention to the concepts of "layered view" and "Animation proxy", you can do something unexpected simply by making some simple settings in Interface Builder. In addition, in the process of writing code, you can make some animation effects by changing the previous message to YourView (can be any view) to send a message to [YourView animator].

Looking at Nsanimatablepropertycontainer, you can also add your own animated properties to the view.

View depiction

You are automatically notified when a view is hidden, displayed, and is about to be depicted. These notifications allow you to create a receive method by creating subclasses. This will help you to do a more efficient pre-calculation and caching when drawing views. And you can manipulate all the child views of a view at the same time.

And Quick View work together

You can write your own quick-view plug-in so you can quickly view the contents of a custom document you've created by previewing it directly. This is the same as in version 10.4, which allows you to create Spotlight plugins to index documents.

You can also request a quick view of the generated document preview content directly by invoking the Qlthumbnailimagecreate () function provided in the Quicklook framework. You can specify the size and type of the preview data, and you can even draw an icon directly (you can add effects such as shadows, page flipping, and so on).

Manage multiple views (for custom pagination controls, etc.)

Now there is a new Nsviewcontroller class that you can use to manage multiple views and support view bindings. This class can save you a lot of code to switch views when a user requests it.

Images or views are rendered in an iphoto form of an animated table

The call is made directly with Ikimagebrowserview. Set one in Interface Builder and start the simulation directly so you can see the effect. The following example does not use a single line of code (and is the default property setting for the control), just a nib file. This example shows you a picture of your desktop, supports multiple selections, arranges automatically, and drags and rearranges the animation effects.

Note that Ikimagebrowserview is a well-crafted control that uses the new Nscollectionview class. This class was previously called Nsgridview and is now called Nscollectionview. At the same time, there is an example called PubSub that uses Ikimagebrowserview, and you can find this example in the/developer/examples/pubsub/newmusic/directory.

Set up your own smart groups, playlists, directories

You can use the two classes of Nsruleeditor and Nspredicateeditor to develop a familiar rule editing interface.

Add a custom view to the menu

Nsmenuitem now provides a-setview (and-view) method for invocation. You can add custom controls directly to the menu without using carbon. The animation produced by the timer can also work, but pay attention to the loops you use. (Must be event tracking loop mode because it is within the menu)

Menu Enhancements

When a menu item is opened, closed, checked, and unchecked, you will be notified by hosting.

You can set different shortcut keys on different menus as long as they perform the same action. If the shortcut key should trigger a disabled option, your application can also respond to it. This improvement may help you to omit some custom code.

Print interface

The print interface has been greatly enhanced, especially with the support of the attached view, and your program can now really customize the parts that need to be printed. If print support is an important part of your program, then you need to take a good look at Nsprintpanel and nspagelayout, which adds a lot of new information and new features to the two classes.

Global type flag Uniform type Identifiers

Leopard now greatly supports UTI through the document structure, including nsdocument, opening, saving tool windows, program information, Nsworkspace, and more. It also supports drag-and-drop types, clipboard data, service customizations, picture types, and other types of support. If you are going to simplify and global the data type of the program, rather than using a lot of duplicate constant definitions, you should take a look at this part of the explanation.

Use a column view like a mail program

The Nssplitview is now visibly enhanced. By carefully reading the API documentation, you will find it easy to programmatically collapse, modify the column thickness and activation area, or even specify a region for dragging. And some bugs have been modified.

Display the document icon in the title bar

To achieve this, you do not need to use the nsdocument system, now the system provides a new way to control the form of icon display, whether the need to pop-up menus and other functions.

HUD window similar to iphoto toolbar

Now the system supports a HUD window form, which is included in the Nspanel. This window can be set to a borderless form and is displayed as a translucent black background. Using this window directly, you can save a lot of code to customize this type of window.

Controls the material and metal form of the window and controls the position of the drawing

Now the system provides a way to detect window material border thickness. For example, you can define the 100 points at the bottom of the window should have a material. These methods can help you simplify the subclass of the custom window, or simply write an extra view of the window for a particular background.

Spaces integration

When your window is displayed in a specific space virtual desktop, or when the user switches space, you can choose a different display mode. Basically, you can specify whether your window needs to use the default behavior (shown in a virtual desktop, remain on the desktop until you specify its movement), or it will always appear on the current screen, or it will always appear on all the desktops. See Nswindowcollectionbehaviour for more information.

"Don't remind me again."

In the past, if you need to display the dialog box like this (usually a single box at the bottom of the dialog box, the hint will no longer appear), you need to write a lot of code to implement. In leopard, Nsalert directly supports this form of dialog box. You can save a lot of code and the effort it takes to create such a window. See Nsalert in Setshowssuppressionbutton: and-setaccessoryview: Methods.

Dock icons for different windows and programs, including badges and numbers

The system provides a new class called Nsdocktile that allows you to control the minimized windows on the dock and your own program icons. This class supports the addition and cancellation of icon stamps, as well as the ability to customize the text on the stamp. For example, if you want to display a progress bar or other status in the icon, you can do so through this class. This saves you a lot of custom code, and you don't have to draw it yourself on the icon.

Accurate mouse Tracking

As previously mentioned, Leopard now has a better option to track the position of the mouse: Nstrackingarea. You can use it to get a precise mouse position (mouse entry, exit, or move), even if your program is not active and can be traced.

More Text formats

The text system now supports the Oasis Open document format and the ECMA Office Open XML format, while supporting the new version of Word format, so you can add import and export options directly to your program without having to write additional code.

Layout Manager Enhancements

If you have been using Nslayoutmanager to manage the layout, you should understand that it now supports non-contiguous layouts. If you want to spend some time learning how to do it, it has a lot of performance improvements for your program. Some improvements are also included, such as getting the base offset for a particular font and displaying items that are not visible.

Safari 3-style search results

Safari 3 provides a beautiful visual effect of search results, highlighting search results as small yellow squares in the body. You can also provide this style of support, using the Showfindindicatorforrange: method in Nstextview, you can use it directly. Do something good with this nice function, but don't do bad things:)

Automatic linking, referencing, and built-in picture editing

Nstextview now supports these features and also includes linked mouse prompts. You can even check the nsattributedstring to see if it finds a URL in the specified location. It also saves you a lot of custom code.

Spell check

You may have noticed the new grammar checker (green dashed line) available in the Cocoa text system, and you can call them directly.

Remove unwanted pictures from the button

If you have a custom button in your program, you probably draw a lot of pictures for the different states of the buttons, normal state, pressed state and so on, and you have to write a lot of code to squeeze the pictures together. Leopard can help you save these pictures, through Nsimage's-istemplate and Nscell-backgroundstyle. Please refer to the documentation, but basically:

You can specify a picture to tell cocoa that this is a "mask" and cocoa will help you highlight it in different situations (a bit similar to the state of those buttons in the lower left of ical)

You can tell Nscell how the text is displayed, in what context: dark, bright, protruding, or recessed. You can just draw a picture to achieve the effect of the button (highlighting, not highlighting, carving, projecting) of the bookmark in Safari.

This feature can significantly reduce your program size and memory footprint, as well as reduce your artwork budget. Please refer to the documentation, also note that Nsstatusitem supports this feature.

Free images and icons

We've been stealing apple icons for a long time, and now you can use them for free. -imagenamed in Nsimage: There are a number of new standard images available for you to use, including safari bookmark icons, all arrows, gear icons, computer icons, Bluetooth and Bonjour logos, user logos, information icons and much more. Your program's size and icon design budget can be drastically reduced. (Don't worry, Nsbuttoncell supports imagescaling parameters so these icons can be scaled arbitrarily)

If you want to see these icons, drag a nsimageview into the interface builder and use the drop-down boxes to see the icons, all inside.

Draw complex graphics by tiling small pictures

Leopard now provides two functions, called Nsdrawthreepartimage () and Nsdrawninepartimage (), respectively. These two functions allow you to fill in large graphics with small pictures. These functions are resolution-independent and can help you save more than 20 lines of custom code.

Recessed form of box

Nsbox now supports custom background and border colors, and you can also choose your own border width and fillet. You can also throw away a custom subclass control.

Built-in color ramp support available

Everyone in cocoa development is using ctgradient, it's great. In leopard, Apple finally offered the Nsgradient class. Take a closer look at the methods provided by this class to help you create a color gradient user interface.

Enhanced Tableviews and Outlineviews

I've been building Nstableview subclasses myself, so that I can edit the contents of the table (such as check boxes, etc.) and not select the entire row at the same time. Leopard provides this support, allowing you to choose whether you want to track the editing status of a table. The system now provides an inherited approach that allows us to select the content of the control and supports drag-and-drop, contextual menus, and direct editing.

If you need itunes or a finder sidebar effect, you can do it too. Now that the system provides a fixed-width table column, you can directly achieve this effect.

SOURCE list

We've been talking about this for years, and Leopard finally lets you create highlights in Nstableview and Nsoutlineview. Do not write custom code, you can make I what what the software effect.

Path display in ITunes song store form

The new Nspathcontrol (and the cell with the Componentcell or something like it) allows you to display that path for this form, just like the itunes song store. Can be displayed as a pop-up menu, or like a path strip. You can see it in Interface Builder.

Built-in picture editing

Ikimageview (provided directly by Interface Builder) gives you a picture view and automatically supports picture editing, cutting, selecting, moving, footnotes, and other features of the preview, without having to write your own code at all. Now that you're working on a picture, there's no reason not to provide a simple picture editing feature.

Built-in PDF viewing and browsing

Pdfview provides you with support for viewing, selecting, zooming, and so on in the PDF file preview format. The newly added Pdfthumbnailview can even let you list the page numbers in the PDF. No need to write code, built-in support.

Uninstalling packages

NSBundle now supports uninstall, you can save some memory.

Get memory and processor information

Nsprocessinfo can now call-physicalmemory to tell you the memory capacity, without using carbon, you can also use-processorcount to get the number of CPUs, Gets the number of activated CPUs with-activeprocessorcount.

Simpler order of precedence sequences

Take a look at Nsoperation and Nsoperationqueue, which is a relatively simple multithreaded support provided by the system, and should be better than you write yourself.

Show Date

NSDateFormatter supports more date forms. Nscalendar can help you calculate the time difference, which is shown in the form of "weeks ago" and "months ago".

String encoding

NSString supports more encodings, and you can see if leopard helps you save yourself time coding.

More efficient expressions for Core data

Nsexpression now supports subqueries, clustered queries, federated queries, cross-queries, and decrement queries. You can save a lot of memory and code, without having to write your own program implementation. If you want to write faster, more customizable, and less code, you must look at the parts of the documentation for the SQL store in core data.

Scripting support

There are too many enhanced scripting features available in Leopard that cannot be enumerated. If you want to use scripting support in your program, read the Fundation release notes (read from the beginning to the end). You can write a lot less code, and the program runs more stably and with fewer errors.

Work together with ical and other data

The Calendar storage framework allows you to access, edit, and update ical data, including calendars, tasks, time, and so on, and is easy to use. This data is also supported for filtering and searching.

RSS Support

If you want to deal with RSS simply, look at the pubsub framework. This example is provided by the system itself.

Interface Builder

Look at the many new objects available in Interface Builder and you'll find lots of interesting things. Includes automation-related views, AppleScript editors, visual creation toolbars, video interception, and many quartz composer related things. The system even provides support for bundling compatible Nsdictionarycontroller, allowing you to edit the contents of Nsdictionary in Nstableview.

The system also provides the API, you can write your own IB objects or toolbars, if you want to do something for other developers, you can look at this part. You can also make your own development easier by writing these.

Conclusion

Now it's time to do something about it, and I think you'll want to try it yourself. Take a moment to look at Xcode and interface Builder, and these latest offers will help you save a lot of time in future development. Original address: Http://mattgemmell.com/2007/10/28/get-rid-of-your-code-with-leopard

Fast Lookup directory for MAC Development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.