OC listens to the click event of Hbuilder

JS side processing:

$("#back").click(function(){

var notifyCenter = plus.ios.importClass(“NSNotificationCenter”);

notifyCenter.defaultCenter().postNotificationNameobject(“SendNotifyFromHbuilder”,”information”);

});

OC side processing:

[NSNotificationCenter defaultCenter] addObserver: self selector:@selector(notifyAction:) name:@“SendNotifyFromHbuilder” object:nil];


- (void)notifyAction:(NSNotification *)notify{

    // handle the event

}



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324641852&siteId=291194637