I think this is simple, but i am have no idea. I create a upper class:

#import "downClass.h"
@interface MyUpperClass : NSObject

and in than I create

downClass *test = [[downClass alloc] init].


Than in my downClass is just a think like
@interface downClass: NSObject

They are not Inheritance, so [super function] don't work. My problem is I
want to call a function in MyUpperClass and I am in downClass. It's a
instance function (like "- (void) function", not with +) so [MyUpperClass
function] will not work.

The solution was use
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(function:)
name:@"observer" object:nil];
to listen and
[[NSNotificationCenter defaultCenter] postNotificationName:@"observer"
object:nil];
to call.

Do this a correct way to do? There are another way better than this? For me,
this way cause problem because it's a little GOTO style and in debug make
things difficult.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to