Question

How can I send my NSDictionary on my selector, as a parameter, and how I can read it?

NSDictionary * dict = [[NSDictionary alloc]initWithObjectsAndKeys:@"idOferta",@"test", nil];                
NSThread * viewsThread = [[NSThread alloc] initWithTarget:self selector:@selector(updateViewStatistic:) object:dict];
[viewsThread start];

- (void)updateViewStatistic:(NSThread *)mt {
      NSLog(@"dictionary %@",dict); 
}
Was it helpful?

Solution

Change your updateViewStatistic: method to something like this:

- (void)updateViewStatistic:(NSDictionary *)dictionary
{
    NSLog(@"Dictionary: %@", dictionary);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top