Monday, November 23, 2009

Special Key Symbols


or

Escape U+238B

Tab forward U+21E5

Tab back U+21E4

Capslock U+21EA

Shift U+21E7

Control U+2303

Option (Alt, Alternative) U+2325

Apple symbol 1 U+F8FF

Command (Open Apple) 2 U+2318

SpaceU +2423

Return U+23CE

Return U+21A9

Delete back U+232B

Delete forward U+2326

﹖⃝ Help U+003F & U+20DD

Home U+21F1
U+2196
U+21B8


End U+21F2
End U+2198


Pageup U+21DE

Pagedown U+21DF

Up arrow U+2191
U+21E1


Down arrow U+2193
U+21E3


Left arrow U+2190
U+21E0

Right arrow U+2192
U+21E2

Clear U+2327

Numberlock U+21ED

Enter U+2324

Eject U+23CF

Power U+233D



Tuesday, February 17, 2009

Nib file, Binding, and Memory Management in Cocoa

"Objects in a nib file are initially created with a retain count of 1. As it rebuilds the object hierarchy, however, Cocoa autoreleases any objects that have a parent or owning object, such as views nested inside view hierarchies. By the time the nib-loading code is complete, only the top-level objects in the nib file have a positive retain count and no owning object. This makes the top-level objects a potential memory leak if your code does not assume responsibility for them. "

You don't need to worry about this if the File's Owner is NSWindowController or NSViewController, or their subclasses.

Use either of the following ways to dealloc the top-levels

- use [NSNib instantiateNibWithOwner: topLevelObjects:] to keep an array to top-level objects, and release them in dealloc

- create an IBOutlet for each top-level object in the nib and release the objects in dealloc, can use property
@property (nonatomic, retain) IBOutlet NSTableView *mTableView;



Note you may still get a memory leak if you use Cocoa bindings in the nib. This occurs when an object in the nib binds to the File’s Owner. The File’s Owner never gets deallocated in this case, and thus neither do the top-level objects.

- Unbind the bindings programmatically. You’ll need to do this elsewhere than the File Owner’s dealloc,
which won’t get called unless you unbind.

- Bind to a different object in the nib rather than to the File’s Owner.


Now in MainMenu.nib, the file's owner is NSApplication.

(1) Subclass NSApplication so that it has outlets to all the top-level
objects and release them on NSApplication dealloc. (rarely used?)
(2) Instantiate a delegate to handle applicationWillTerminate: and use
that to release all objects, except, urm, how about the delegate
itself
(3) Don't worry about it, since the app is going away anyway and will
take with it all top-level objects.

Friday, December 05, 2008

Nib file explained

Interface Builder 2.x. The NIB will take the form of a package of three files:
classes.nib, info.nib,and keyedobjects.nib. The last of these contains all the
information Cocoa needs to reconstitute objects for use in an application. The other
two files contain information about the class hierarchy and other settings that made it
possible to edit the NIB in IB 2.0; removing them produces a NIB package that is
usable,but not editable (unless you deselect “Flatten compiled XIB files” in your
target’s build settings). This form of NIB can be used on any version of Mac OS X,and
edited by IB 2 or 3.

Tuesday, September 16, 2008

Replace __MyCompanyName__ in XCode file

defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{ "ORGANIZATIONNAME" = "YourCompany Inc.";}'

Monday, August 11, 2008

破解注册码-(ZT from itPub)

网上有许多令人心动的共享软件,可惜的是它们或多或少都存在各种限制,对于我等贫苦一族来说,面对昂贵的注册费用只能望而却步,而且支付起来也不太方便(特别是国外的共享软件)。现在,只要利用Google强大的搜索功能,再配合一定的搜索技巧就会让你有意外的发现。

  打开Google的搜索页面后,在搜索栏内填上你要搜索的软件名称、空格,并在后面加上“94fbr”的搜索代码(例如:WinZIP 94fbr),单击“搜索”按钮后你会看到所要的东西了。但该方法也并不是万能的,当没有找到合适的结果,则不妨再试试输入“软件名称 crack OR sn OR 破解”,一般都能找到了。

Sunday, August 10, 2008

通过MVC模式将Web视图和逻辑代码分离

http://www.itpub.net/thread-991134-1-5.html

Tuesday, August 05, 2008

\x1b in C

These are guaranteed by the Standard:

\a is alert (whether this means a bleep, a flash, or something else, is
implementation-dependant).
\b is backspace.
\f is form feed.
\n is new line. It is the character which represents a new line in files
opened in text mode.
\r is carriage return.
\t is a horizontal tab. Size depends on the implementation.
\v is a vertical tab, whatever that is on modern devices.
\' is a literal single quote mark.
\" is a literal double quote mark.
\? is a literal question mark (trigrahps, avoidance, ftpo).
\\ is a literal backslash.

\ is the character represented by that octal number, and
\x is the character represented by that hexadecimal number.
The only ones of these of which you reliably know the meaning are
\0, \x0, and equivalent, all of which are character 0, the null
character.

\x1b, as you mention above, is the character with hex value 1b, i.e.
decimal 27. This may or may not represent ESC. It is the character point
for ESC in a very common character set; whether this means that your
implementation also transmits it as an Escape, and whether the OS then
does something sensible with it, is up to them. The Standard neither
does nor reasonably can require it.