В AppDelegate.m я определил
#import "AppDelegate.h"
#import "allerta.h"
@implementation AppDelegate
@synthesize window = _window;
-(void)awakeFromNib {
// Add an observer that will respond to loginComplete
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(alerticonstatus:)
name:@"alert" object:nil];
// Post a notification to loginComplete
[[NSNotificationCenter defaultCenter] postNotificationName:@"alert" object:nil];
}
@end
Я хочу позвонить lerticonstatus по адресу allerta.h:
#import <Foundation/Foundation.h>
@interface allerta : NSObject{
}
-(void)alerticonstatus:(NSNotification *)note;
@end
lerta.m
#import "allerta.h"
@implementation allerta
-(void)alerticonstatus:(NSNotification *)note {
NSLog(@"called alerticonstatus");
}
@end
Могу ли я импортировать функцию с параметром @selector из другого файла, например allerta.h?Теперь у меня ошибка SIGABRT.Вы можете мне помочь?Спасибо.