我正在使用Shuttle Magstripe reader,我正在将响应[notification object]转换为NSData,然后将其转换为NSString
NSData* data = [notification object];
NSString* response = [[NSString alloc] initWithData: data encoding:NSASCIIStringEncoding];但是当我尝试NSLog(@"RESPONSE: %@", response);的时候
输出只是一个倒置的?,你有什么想法来正确处理Shuttle MagStripe阅读器的滑动响应吗?
发布于 2013-01-10 13:54:42
尝试这种方式,将信息作为
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:<#yourNSDataObject> forKey:@"pass"];
[[NSNotificationCenter defaultCenter] postNotificationName:@"myevent" object:nil userInfo:userInfo];在接收器上获取对象的方法如下
- (void)receiveEvent:(NSNotification *)notification {
NSData pass = [[notification userInfo] valueForKey:@"pass"];
}https://stackoverflow.com/questions/14251533
复制相似问题