mirror of
https://github.com/MacDownApp/macdown.git
synced 2026-05-17 12:40:37 +00:00
24 lines
582 B
Objective-C
24 lines
582 B
Objective-C
//
|
|
// NSJSONSerialization+File.m
|
|
// MacDown
|
|
//
|
|
// Created by Tzu-ping Chung on 15/3.
|
|
// Copyright (c) 2015 Tzu-ping Chung . All rights reserved.
|
|
//
|
|
|
|
#import "NSJSONSerialization+File.h"
|
|
|
|
@implementation NSJSONSerialization (File)
|
|
|
|
+ (id)JSONObjectWithFileAtURL:(NSURL *)url options:(NSJSONReadingOptions)opt
|
|
error:(NSError *__autoreleasing *)error
|
|
{
|
|
NSInputStream *stream = [NSInputStream inputStreamWithURL:url];
|
|
[stream open];
|
|
id obj = [self JSONObjectWithStream:stream options:opt error:error];
|
|
[stream close];
|
|
return obj;
|
|
}
|
|
|
|
@end
|