object c ÄÚ´æ¹ÜÀí
¿´ÁËϹٷ½ÎĵµµÄ¹ØÓÚobject c µÄÄÚ´æ¹ÜÀí,×ܽáÏÂ:
ÔÚiphoneÖÐobject c ÖеÄÄÚ´æ¹ÜÀíÊÇͨ¹ý¼ÆÊýÆ÷À´¹ÜÀíµÄ,ÿ¸ö¶ÔÏóÄÚ²¿¶¼ÓÐÒ»¸ö¼ÆÊýÆ÷.н¨Ò»¸ö¶ÔÏó,»òÕßÕâ¸ö¶ÔÏ󱻯äËû¶ÔÏóÒýÓÃ,¶à»áʹ¼ÆÊýÆ÷¼Ó1.Retain Ôö¼Ó¼ÆÊýÆ÷Öµ release ¼õÉÙ¼ÆÊýÆ÷Öµ.µ±¼ÆÊýÆ÷Ϊ0ʱ¶ÔÏó¾Ídealloc×Ô¼º.
ÔÚobject cÖÐÄãÉú³ÉµÄÒ»¸ö¶ÔÏóÄÇôÄã¾ÍÓÐÔðÈÎÈ¥ÊÍ·ÅËü£¬ÄÚ´æ¹ÜÀíµÄÒ»°ã¹æÔò£º
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.
¿¼ÂÇÏÂÃæÕâ¸öÀý×Ó£º
Thingamajig *thingamajig = [[Thingamajig alloc] init];
NSArray *sprockets = [thingamajig sprockets];
[thingamajig release];
thingamajig ÐèÒªrelease£¬ÒòΪºÜÏÔÈ»ÕâÀïÎÒÃÇÊÇthingamajig µÄowner¡££¨µÚÒ»Ìõ¹æÔò£©
ÄÇôsprockets Ϊʲô²»ÐèÒªreleaseÄØ¡£
Ê×ÏÈÎÒÃDz»ÊÇ sprockets µÄ creater.£¨µÚÒ»Ìõ¹æÔò£©,ÎÒÃÇҲûÓÐexpressing an ownership interest£¬ÒòΪÎÒÃÇûÓÐ
retainËü£¬£¨µÚ¶þÌõ¹æÔò£© ËùÒÔÎÒÃDz»¸ºÔðreleaseËü¡£
¾ßÌåÀ´¿´ thingamajig µÄ sprockets·½·¨µÄʵÏÖ£º
(NSArray *)sprockets {
NSArray *array;
array = [[NSArray alloc] initWithObjects:mainSprocket,auxiliarySprocket, nil];
return [array autorelease];
}
¿É¼û·ÖÅäµÄÄÚ´æÔÚ·
Ïà¹ØÎĵµ£º
ÍøÂí¼ÓÃÜÖУ¬Ä¿Ç°Óиöfunction(p,a,c,k,e,d)µÄ£¬·Ç³£ÌÖÑᣬÎÒÒ²ÊÇÉî¶ñÍ´¾ø£¬¼ÇµÃÎÒ¸Õ¿ªÊ¼Åöµ½ËüµÄʱºò£¬Æ´ÃüµØ¶Áº¯Êý£¬ÄǸö½ÐÍ´¿à°¡£¬¿Ä¿Ä°í°íµØÃãÇ¿¸ãÁ˳öÀ´¡£½ñÌ죬ͻȻ¿´¼ûÁËfunction(p,a,c,k,e,d)µÄ½âÃÜ´úÂ룬¸ßÐ˶¼À´²»¼°
<script>
a=62;
function encode() {
var code = document.getElementById('code' ......
ºê
È«´óд, Èç¹û±ØÒª, ÓÃÁ¬×Ö·ûÁ¬½Óµ¥´Ê
#define SIZE_LIMIT 1024
#define CONFIG_DEBUG 1
#define PRODUCT_ID 0x1123
ö¾Ù
µ¥´ÊÊ××Öĸ´óд, ²»ÓÃÁ¬×Ö·û
enum {
KeyNumLock,
KeyShift,
Key1,
KayA
} Key;
......
ת×Ô£ºhttp://blog.csdn.net/Lambol_8309/archive/2009/09/06/4524453.aspx
Ôø¾Åöµ½¹ýÈÃÄãÃԻ󲻽⡢ÀàËÆÓÚint * (* (*fp1) (int) ) [10];ÕâÑùµÄ±äÁ¿ÉùÃ÷Â𣿱¾ÎĽ«ÓÉÒ×µ½ÄÑ£¬Ò»²½Ò»²½½Ì»áÄãÈçºÎÀí½âÕâÖÖ¸´ÔÓµÄC/C++ÉùÃ÷¡£
¡¡¡¡ÎÒÃǽ«´ÓÿÌì¶¼ÄÜÅöµ½µÄ½Ï¼òµ¥µÄÉùÃ÷ÈëÊÖ£¬È»ºóÖð²½¼ÓÈëconstÐÞÊηûºÍtypedef£¬»¹Óк¯ÊýÖ¸Õ ......
cÎļþ²Ù×÷¾ÍÕâô¼òµ¥
Îļþ²Ù×÷£¬ÉÔ΢һ×ܽá.¡£
FILEÊÇÒ»¸ö½á¹¹ÌåÀàÐÍ£¬ÔÚTCºÍVSÖж¨Òå²»Ïàͬ£¬ËûµÄ×÷ÓþÍÊÇÔÚfopen()Ö®ºó±£´æÁË´ò¿ªÎļþµÄÐÅÏ¢¡£Ò²¾ÍÊÇ˵²Ù×÷ϵͳ°ïÎÒÃÇÍê³ÉÁË£¬ÎÒÃDz»Óùܣ¬´ó´ó½µµÍÁËÄѶȰɡ£
Ê×ÏÈÎÒÃÇ¿¼ÂÇ϶ÔÎļþµÄ²Ù×÷£¬ÎļþÀàÐÍ·ÖΪÎı¾ºÍ¶þ½øÖÆ¡£¶ÁдÎļþµÄº¯ÊýÒ»°ãÇ°ÃæÓиöf£¬Ò²¾Í±íʾfile£¬open ......