Commit efdeda8d authored by Andrew D'Abbraccio's avatar Andrew D'Abbraccio

tested using JSON parser, didn't quite work

parent 13d8c876
......@@ -115,7 +115,10 @@ static int BOOK_ID_LENGTH = 14;
[self.callNumList removeAllObjects];
[self.titleList removeAllObjects];
[self.scannedBookList removeAllObjects];
NSLog(@"%@", scannedBooks);
NSData *data = [scannedBooks dataUsingEncoding:NSUTF8StringEncoding];
id json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
NSLog(@"%@", [json objectForKey:@"title"]);
//Extract book ID
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"\"id\"\\:\"([0-9]*)\"\\," options:0 error: Nil];
NSArray *rangeList = [regex matchesInString:scannedBooks options:0 range:NSMakeRange(0, [scannedBooks length])];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment