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];
}
¿É¼û·ÖÅäµÄÄÚ´æÔÚ·
Ïà¹ØÎĵµ£º
ÉîÈëÀí½â²¢Ó¦ÓÃC51¶Ô±ê×¼ANSICµÄÀ©Õ¹ÊÇѧϰC51µÄ¹Ø¼üÖ®Ò»¡£ÒòΪ´ó¶àÊýÀ©Õ¹¹¦Äܶ¼ÊÇÖ±½ÓÕë¶Ô8051ϵÁÐCPUÓ²¼þµÄ¡£´óÖÂÓÐÒÔÏÂ8 Àࣺ 8051´æ´¢ÀàÐͼ°´æ´¢ÇøÓòl; ´æ´¢Ä£Ê½l´æ´¢Æ÷ÀàÐÍÉùÃ÷l±äÁ¿ÀàÐÍÉùÃ÷l λ±äÁ¿ÓëλѰַl ÌØÊ⹦ÄܼĴæÆ÷(SFR)l C51Ö¸Õël º¯ÊýÊôÐÔ¾ßÌå˵Ã÷ÈçÏÂ(8031ΪȱʡCPU)¡£
µÚÒ»½Ú Keil C ......
ÔÚCÓïÑÔÀȫ¾Ö±äÁ¿Èç¹û²»³õʼ»¯µÄ»°£¬Ä¬ÈÏΪ0£¬Ò²¾ÍÊÇ˵ÔÚÈ«¾Ö¿Õ¼äÀ
int x =0; ¸ú int x; µÄЧ¹û¿´ÆðÀ´ÊÇÒ»ÑùµÄ¡£µ«ÆäʵÕâÀïÃæµÄ²î±ðºÜ´ó£¬Ç¿ÁÒ½¨Òé´ó¼ÒËùÓеÄÈ«¾Ö±äÁ¿¶¼Òª³õʼ»¯£¬ËûÃǵÄÖ÷Òª²î±ðÈçÏ£º
±àÒëÆ÷ÔÚ±àÒëµÄʱºòÕë¶ÔÕâÁ½ÖÖÇé¿ö»á²úÉúÁ½ÖÖ·ûºÅ·ÅÔÚÄ¿±êÎļþµÄ·ûºÅ±íÖУ¬¶ÔÓÚ³õʼ»¯µÄ£¬½ÐÇ¿·ûºÅ£¬Î´³õʼ»¯µÄ ......
ASA¾ÖÓòÍøC/S¼Ü¹¹ÅäÖÃ×îÖÕÍêÃÀ³¬Ç¿°æ............
¾ßÌåʵÏÖÓÐÁ½ÖÖ£¬ÈçÏ£º
Ò»¡¢·þÎñÆ÷¶Ë°²×°ASA£¬ÒòΪҪʹÓÃASAÖÐ×Ô´øµÄSybase Central¹¤¾ß¡£
·þÎñÆ÷¶Ë¿ªÆô£ºscjview.exe£¨¼´£ºSybase Central£¬×¢Òâ²»ÊÇSybase Central-Sybase Central¡£½çÃæÈçͼ£º£©
1¡¢ÉèÖÃÈçÏ£ºfile£new£server
·þÎñÆ÷Ãû×ÖËæ±ãÆð£¨±ãÓÚÕâ¸ö¹¤¾ß ......
ºê
È«´óд, Èç¹û±ØÒª, ÓÃÁ¬×Ö·ûÁ¬½Óµ¥´Ê
#define SIZE_LIMIT 1024
#define CONFIG_DEBUG 1
#define PRODUCT_ID 0x1123
ö¾Ù
µ¥´ÊÊ××Öĸ´óд, ²»ÓÃÁ¬×Ö·û
enum {
KeyNumLock,
KeyShift,
Key1,
KayA
} Key;
......