使用Xcode 查看objective-C的彙編代碼,xcodeobjective-c
Xcode內建將某一個源檔案轉化成彙編的功能,
彙編的部分代碼如下:
# Assembly output for assemble.c# Generated at 2:29:34 下午 on 星期一, 八月 18, 2014# Using Debug configuration, x86_64 architecture for dataStruct target of dataStruct project.section__TEXT,__text,regular,pure_instructions.section__DWARF,__debug_info,regular,debugLsection_info:.section__DWARF,__debug_abbrev,regular,debugLsection_abbrev:.section__DWARF,__debug_aranges,regular,debug.section__DWARF,__debug_macinfo,regular,debug.section__DWARF,__debug_line,regular,debugLsection_line:.section__DWARF,__debug_loc,regular,debug.section__DWARF,__debug_str,regular,debugLinfo_string:.section__DWARF,__debug_ranges,regular,debugLdebug_range:.section__DWARF,__debug_loc,regular,debugLsection_debug_loc:.section__TEXT,__text,regular,pure_instructionsLtext_begin:.section__DATA,__data.file1 "/Users/guoxiaodong/Documents/codeExemple/dataStruct/assemble.c".section__TEXT,__text,regular,pure_instructions.globl_func0.align4, 0x90_func0: ## @func0
Xcode 下使用objective-c文法編寫程式,會產生m 檔案,裡面的代碼是什
pool = [[NSAutoreleasePool alloc] init];
上面的寫法是建立一個自動釋放池,會在[pool autorelese];時向池子中的所有對象發送一條release訊息,並且自身會銷毀.而[pool drain];這條語句只會向池中對象發送release訊息,並不會自身銷毀,也就是說這個池子還存在,還可以繼續使用.(pool這個對象還沒有dealloc)
我也是新手希望能有大神標準回複.
objective-c 可以調用標準c++代碼?就是說標準c++可以不可以嵌入到xcode項目中去?
蘋果的Objective-C編譯器允許使用者在同一個源檔案裡自由地混合使用C++和Objective-C,混編後的語言叫Objective-C++。有了它,你就可以在Objective-C應用程式中使用已有的C++類庫。