I have two projects open in Xcode 6.4. Both use the follow declaration:
- (void)startService
{
__weak typeof(self) weakSelf = self;
[self.messageOperationQueue addOperationWithBlock:^{
NSDictionary *storedMessages = [mySettings get:kStorageName withDefault:@{} storageType:kMySettingsStorageTypeDiskMapped];
[weakSelf.messages addEntriesFromDictionary:storedMessages];
}];
}
However, in one project there are no errors, and in the other project I get a compiler error:
Expected ';' at end of declaration
It wants me to put a semi-colon after __weak typeof(self). I have suspicion that I'm just doing something really dumb, but I'm having trouble figuring out what. Also, I know I could replace the typeof(self)
with myClass *
.