Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PLUC Inventory - Senior Design
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Andrew D'Abbraccio
PLUC Inventory - Senior Design
Commits
efdeda8d
Commit
efdeda8d
authored
Mar 27, 2015
by
Andrew D'Abbraccio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tested using JSON parser, didn't quite work
parent
13d8c876
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
WAMI/WAMI/ScanBookViewController.m
WAMI/WAMI/ScanBookViewController.m
+4
-1
No files found.
WAMI/WAMI/ScanBookViewController.m
View file @
efdeda8d
...
...
@@ -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
])];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment