IOS interview questions collection (Continuous updates)

Source: Internet
Author: User

Last Updated: 2012: 05: 31
Watch the latest IOS interview questions collection, please stay tuned to this blog: http://blog.csdn.net/iukey/article/details/7590557





1. Is object-C inherited? If no, what should I replace it?

No, protocol.

2. Is there a private Method for Object-C? What about private variables?

No, yes.

3. What is the difference between # import and # include? What does @ Class represent?

# Import can prevent repeated references. # include cannot. @ Class declares a class.

4. Memory Management for Object-C?

Reference Counter.

5. why are many built-in classes, for example, the attribute of tableviewcontroller's delegate is assign, not retain?

Prevents circular references.

6. When do I use copy, assign, and retain when defining attributes?

Copy: copy an object. Assign: pass value, which is generally used for basic types. Retain: Transfer address, reference counter plus one.

7. When is the object release?

The reference counter is 0.

8. Is there garbage collection in IOS?

No.

9. What is the reuse mechanism of tableview?

Reuse tags.

10. When is the loadview, viewdidload, and viewdidunload of viewcontroller called? What should I do in the Custom viewcontroller functions?

When the view is nil, loadview is called. When the view is loaded, viewdidload is called. When the view is released, viewdidunload is called.

11. When is didreceivememorywarning of viewcontroller called? What is the default operation?

If the memory exceeds the threshold, try to release the view.

12. List common centralized multi-thread implementations in cocoa and discuss several solutions to multi-thread security. Where can multithreading be used in general?

Nsthread, gcd, etc. Try to use the upper-layer sub-assembly method to implement multithreading instead of manually calling nsthread.

13. How does MVC be implemented in cocoa?

Model -- View -- controller.

14. What are the differences between delegate and notification?


15. What is the difference between self and self?

16. What does ID and nil represent?

ID is equivalent to void *, and nil is a null object.

17. The set methods and meanings of memory management autorelease, retain, copy, and assign?
18. What is the role of category?
19. Delegate (example)

20. retaincount?

21. In objc, is the method opposite to alloc semantics dealloc or release? The method opposite to the retain syntax is dealloc or release. Why? The method to be paired with alloc is dealloc or release. Why?

22. In the method of an object:

Self. Name = "object"; and

Name = "object"

Is there any difference?

23. Is there any problem with this Code:

@ Implementation person

-(Void) setage :( INT) newage {

Self. Age = newage;

}

@ End

24. What is the retain count of the person object after each line of code below is executed?

Person * person = [[person alloc] init];

[Person retain];

[Person release];

[Person release];

25. When will the autorelease object be release?

26. How can I modify the code?

For (INT I = 0; I <somelargenumber; I ++ ){

Nsstring * string = @ "ABC ";

String = [String lowercasestring];

String = [String stringbyappendingstring: @ "XYZ"];

Nslog (@ "% @", string );

}

27. What is the relationship between autorelease and GC?

28. What is notification?

29. When to use delegate and notification?

30. What are KVC and KVO?

31. What is the difference between notification and KVO?

32. How is KVO implemented in objc?

33. What are the advantages of thread understanding?

34. Evaluate the knowledge of @ interface and @ propety

35. What types of type conversion in objective-C are classified?

36. Understanding of Polymorphism


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.