Objective C block gives link error
Posted
by ennuikiller
on Stack Overflow
See other posts from Stack Overflow
or by ennuikiller
Published on 2010-04-19T01:15:56Z
Indexed on
2010/04/19
1:23 UTC
Read the original article
Hit count: 474
I'm trying to use objective-c blocks for some iPhone programming and am getting the following link time error:
The relevant code is:
- (NSDictionary *) getDistances {
CLLocationCoordinate2D parkingSpace;
NSMutableDictionary *dict;
NSIndexSet *indexForUser;
BOOL (^test)(id obj, NSUInteger idx, BOOL *stop);
test = ^ (id obj, NSUInteger idx, BOOL *stop) {
NSString *user = (NSString *)[(NSDictionary *)obj valueForKey:@"userid"];
if ([user isEqualToString:self->sharedUser.userName]) {
return YES;
}
return NO;
};
[self->sharedUser.availableParking indexesOfObjectsPassingTest:test];
}
Any help would be very much appreciated!!
© Stack Overflow or respective owner