Im just porting some Objective-C code to MonoTouch but I got stuck here
UIColor *color = ARandomColor(); // ARandomColor Returns a Random UIColor ;)
@synchronized(self) {
[_annotationDict enumerateKeysAndObjectsUsingBlock:^(NSNumber *page, NSArray *annotations, BOOL *stop) {
[annotations makeObjectsPerformSelector:@selector(setColor:) withObject:color];
[self.providerDelegate updateAnnotations:annotations originalAnnotations:nil animated:YES];
}];
}
What would be the MonoTouch Equivalent to @synchronized and enumerateKeysAndObjectsUsingBlock?
Alex
@synchronized(self)should translate tolock(this)in c#.I believe
-enumerateKeysAndObjectsUsingBlock:is more or less just a foreach or for loop, so you just need to do something like