Wednesday, January 8, 2014

Ask a question @ interface

Declare a class
in A.H file@ Interface AAA: UIViewController
{
. . .
}
@ End
In another statement once
A.M file@ Interface AAA ()
- (Void) SetA: (NSString *) Name;
@ End

After that, I was in another BM file, I want to call SetA methods.
AAA * a = [[AAA alloc] init];
[A SetA: name];
Thrown directly, and ask where there is wrong.

Also, such a declaration AAA way, I do not really understand, ask an expert to explain.
Reply:
@ Interface AAA () statement category
AAA is extended class method


Reply:
Why is it that throws

Reply:
This way you stated that only he can use Am, like private methods.
 
@ Interface AAA ()
- (Void) SetA: (NSString *) Name;
@ End

Reply:
reference to the third floor of the reply:
declare you this way, he can use only Am, like private methods.
C / C + + code

@ Interface AAA ()
- (Void) SetA: (NSString *) Name;
@ End

Does not it?

Temporarily can not tell where there is a problem in the evening back to tune a try, what nice newspaper? You try to change the method name.
Reply:
I think there should be no exception, it should be a warning!
@ Interface AAA ()
- (Void) SetA: (NSString *) Name;
@ End
This part of your definition. M source files, so SetA method is a private method in an external call AAA class is a problem, I've tried like without error, but a warning of it (I also wonder why no errors?)

If you want an external method call this method definitely not a private school you can do: The
@ Interface AAA ()
- (Void) SetA: (NSString *) Name;
@ End wrote. H affirms file like
To do so, the only really played a AAA class method of expansion
Reply:
@ Interface AAA ()
- (Void) SetA: (NSString *) Name;
@ End
Defined in A.H or B.H or B.M
Reply:
- (Void) SetA: (NSString *) Name; is an internal method used only in the AM, this method should be rewritten in ah file to the external call
Reply:
- (Void) SetA: (NSString *) Name
After the documents used in the ah, ah external b file called file, you can have access to this method the

You write. M inside, as the expansion of the method of the m-files, private, and can only get myself am calling
Reply:
a21064346, that's good
Reply:
@ Interface AAA ()
- (Void) SetA: (NSString *) Name;
@ End

The method defined herein, are private methods. Therefore, this method can not be found and will return an error when you call in another class.
The solution is to define the method in @ interface AAA in

Reply:
3rd Floor, positive solutions

No comments:

Post a Comment