Sunday, January 12, 2014

New neighborhoods

For the class definition
@ Interface circle: NSOject
{
/ /
}
- (Void) .........
- (Void) .........
@ End

@ Implementation circle
- (Void) .....
.........
@ End

This case, what is the difference between writing methods declared in the interface method and the method is not declared directly in the @ implementation in?
Reply:
Not in @ interface and @ implementation distinction, but to see where the writing method is. H or. M.

Inside. H file is to be written by other classes in the method call (public), and. M is an internal method, I can not say absolutely not be arbitrary external calls, but write. M the intent is to Write a private method (private).

But also pay attention to the words of the variables in the @ interface which is a private variable declared in. H @ property is public, and. M @ property is private.


Reply:
cited a floor yang8456211 reply:
not in @ interface and @ implementation distinction, but to see where the writing method is h or m.. .

Inside. H file is to be written by other classes in the method call (public), and. M is an internal method, I can not say absolutely not be arbitrary external calls, but write. M the intent is to Write a private method (private).

But also pay attention to the words of the variables in the @ interface which is a private variable declared in. H @ property is public, and. M @ property is private.
understand, thank you.
Reply:
Proposed landlord to buy the book to see oc Yeah.
Reply:
reference to the second floor Xuhanyu72 reply:
Quote: references to a floor yang8456211 reply:

Not in @ interface and @ implementation distinction, but to see where the writing method is. H or. M.

Inside. H file is to be written by other classes in the method call (public), and. M is an internal method, I can not say absolutely not be arbitrary external calls, but write. M the intent is to Write a private method (private).

But also pay attention to the words of the variables in the @ interface which is a private variable declared in. H @ property is public, and. M @ property is private.
understand, thank you.


Seeking to sub sprinkle . There can also be problems mentioned ~
Reply:
reference to the third floor tomkillua reply:
oc proposed landlord to buy the book to see the country.
read, but the book did not talk about this, see under some interface has declared some do not feel more confused.
Reply:
There are differences between private
Reply:
public private
Reply:
I have encountered this problem before
ahAfter reading the book come to understand
Reply:
When we refer to a class, you need to import its header file before you can use this class
# Import "myclass.h"

Therefore, the method is defined in the header file is available for access by external class (public)

No comments:

Post a Comment