- (void) setNeededValue:(valueType)newValue;
{
neededValue = newValue;
if( neededValue > threshold )
{
[[NSNotificationCenter defaultCenter] postNotificationName: @"setNeededValue" object: self];
}
}
/////////////////
-(void)callfunction{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setNeededValue) name:@"setNeededValue" object:nil];
NSLog(@"sam: %d,100);
}
setNeededValue 被调用并且调用通知存在问题?当它达到阈值条件时,它会调用函数 callfunction... :( 对此有点新?请帮帮我!!
提前致谢!:)