In my NSNotificationCenter I have something like:
NSMutableDictionary *info = [NSMutableDictionary dictionaryWithCapacity:1];
[info setObject:[NSNumber numberWithChar:cmd[3]] forKey:@"baud"];
[[NSNotificationCenter defaultCenter]postNotificationName:@"baud" object:nil userInfo:info];
Now I would like to have this char back. I need something like:
NSDictionary *userInfo = [note userInfo];
char rate = [userInfo objectForKey:@"baud"];
You are packing the char into an NSNumber
, so you need to extract it again:
char rate = [(NSNumber *)[userInfo objectForKey:@"baud"] charValue];