What is the difference between #import and #include in objective-c?



What is the difference between #import and #include in objective-c?..

Answer / Pawan Kumar Sahu

Both #include and #import directives are used to include header files in Objective-C. The main difference lies in how they handle file inclusion. #include will include the specified header file multiple times if it is included from different places, while #import prevents multiple inclusions of the same header file.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Objective-C Interview Questions

Is objective c similar to java?

1 Answers  


How to call function in objective-c?

1 Answers  


Does a thread created using performselectorinbackground:withobject: creates its own autorelease pool?

1 Answers  


What does alloc mean in objective c?

1 Answers  


What is a delegate objective c?

1 Answers  


Are id and instancetype same? If not, what are differences between them?

1 Answers  


What is protocol in simple words?

1 Answers  


How to convert objective c project to swift?

1 Answers  


What is an objective fact?

1 Answers  


What is meant by not thread safe?

1 Answers  


Can you retain delegates?

1 Answers  


Is objective c deprecated?

1 Answers  


Categories