Reputation: 12951
I m using SBJson version 4.0.0.
I parse my JSON by invoke this function (from SBJson documentation):
+ (id)parserWithBlock:(SBJson4ValueBlock)block
allowMultiRoot:(BOOL)allowMultiRoot
unwrapRootArray:(BOOL)unwrapRootArray
errorHandler:(SBJson4ErrorBlock)eh;
And My code is:
SBJson4Parser *parser = [SBJson4Parser parserWithBlock:^(id item, BOOL *stop) {
NSObject *itemObject = item;
if ([item isKindOfClass:[NSDictionary class]]) {
self.activitiesDict = (NSDictionary*)itemObject;
}
}
allowMultiRoot:NO
unwrapRootArray:NO
errorHandler:^(NSError *error) {
NSLog(@"%@", error);
}];
[parser parse:data];
Does the block that I passed to parserWithBlock function is synchronous?
Can I count that the lines after [parser parse:data];
will run after the parser work?
Upvotes: 1
Views: 908