Skip to content

Commit

Permalink
路径设置
Browse files Browse the repository at this point in the history
添加一个BaseURL的接口,方便使用
  • Loading branch information
songwentong committed Aug 11, 2014
1 parent d83156d commit bed490b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,5 @@
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "WTRequestCenter/WTRequestCenter/WTRequestCenter.m"
timestampString = "429420959.15827"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "412"
endingLineNumber = "412"
landmarkName = "+getImageWithURL:completionHandler:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
5 changes: 4 additions & 1 deletion WTRequestCenter/WTRequestCenter/WTRequestCenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
还有JSON解析功能,还提供来一个URL的表让你来填写
然后直接快捷取URL。
希望能帮到你,谢谢。
如果有任何问题可以在github上向我提出
Mike
*/
Expand Down Expand Up @@ -92,7 +93,9 @@
+(id)JSONObjectWithData:(NSData*)data;

#pragma mark - URL

//根路径
+(BOOL)setBaseURL:(NSString*)url;
+(NSString *)baseURL;
//实际应用示例
+(NSString*)urlWithIndex:(NSInteger)index;

Expand Down
16 changes: 15 additions & 1 deletion WTRequestCenter/WTRequestCenter/WTRequestCenter.m
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,23 @@ +(void)getImageWithURL:(NSURL*)url


#pragma mark - URL

+(BOOL)setBaseURL:(NSString*)url
{
NSUserDefaults *a = [self sharedUserDefaults];
[a setValue:url forKey:@"baseURL"];
return [a synchronize];
}

+(NSString *)baseURL
{
return @"http://www.xxx.com";
NSUserDefaults *a = [self sharedUserDefaults];
NSString *url = [a valueForKey:@"baseURL"];
if (url) {
return @"http://www.xxx.com";
}
return url;

}
//实际应用示例
+(NSString*)urlWithIndex:(NSInteger)index
Expand Down

0 comments on commit bed490b

Please sign in to comment.