Use .mm file extension,when your file has C++ and Objective- C code together.
For import and include there is two different ways to include/import file
i.use < > when adding system declared file(system provided file)
ii.use " " when adding local declared file.(declared by you.)
Forward declaration is used when u do not want to add(import/include) declaration in header file.
Forward declaration tell to compiler that you will get declaration of this later part. And we can add(import/include) that file in .m or .mm file. Mostly forward declaration is used in circular dependency. It means class X uses class Y and Class Y uses Class X.
Xcode shortcut are here
http://developer.apple.com/library/mac/#documentation/IDEs/Conceptual/xcode_help-command_shortcuts/MenuCommands/MenuCommands014.html#//apple_ref/doc/uid/TP40010560-CH2-SW1
http://developer.apple.com/library/mac/#documentation/IDEs/Conceptual/xcode_help-command_shortcuts/TextCmdsByType/TextCmdsByType.html#//apple_ref/doc/uid/TP40010560-CH4-SW1
http://developer.apple.com/library/mac/#documentation/IDEs/Conceptual/xcode_help-command_shortcuts/SystemAndOther/SystemAndOther.html#//apple_ref/doc/uid/TP40010560-CH5-SW3
0 comments:
Post a Comment