我正在使用以下代码从 Python 调用 Obj:
print "Login begin";
nc = Foundation.NSDistributedNotificationCenter.defaultCenter();
userInfo = NSDictionary.dictionaryWithObjectsAndKeys_("7","operation",user,"username",password,"password",None);
nc.postNotificationName_object_userInfo_deliverImmediately_(SIMULATOR_NOTIFICATION,"",userInfo,1);
return;
ObjC 如此接收它:
- (void) recievedNotification:(NSNotification *) notification
{
NSDictionary *userInfo = [notification userInfo];
NSControl *postingObject = [notification object]; // the object that posted the notification
NSMutableDictionary *response = [NSMutableDictionary dictionaryWithCapacity:1];
int switcher = [[userInfo objectForKey:@"operation"] intValue];
switch (switcher) {
我的问题是:如何将值(例如成功/失败布尔值)返回给我的 Python 代码?
顺便说一句,这不是我的代码,是的,我可以看到它的各种问题,但是那个开发人员离开了,现在我被要求更新它。你知道是怎么回事。