57 lines
1.5 KiB
Objective-C
Executable File
57 lines
1.5 KiB
Objective-C
Executable File
//
|
||
// Gateway.m
|
||
// PublicFuncClass
|
||
//
|
||
// Created by an chen on 12-8-30.
|
||
// Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
|
||
//
|
||
|
||
#import "SGGateway.h"
|
||
#import "SGGatewayApi.h"
|
||
#import "SGDefineInfo.h"
|
||
@implementation SGGateway
|
||
static SGGateway* _instanceGateway = nil;
|
||
/*
|
||
* 获得本类实例
|
||
*/
|
||
+(SGGateway*)defaultGateway
|
||
{
|
||
if( _instanceGateway == nil )
|
||
_instanceGateway = [[SGGateway alloc] init];
|
||
return _instanceGateway;
|
||
}
|
||
/*
|
||
* 参数:
|
||
*
|
||
* mv: 回调的目标类
|
||
*
|
||
* returnFunc: 回调的方法
|
||
*
|
||
* obj_do: 于后台交互成功后,将信息传回mv类
|
||
*
|
||
* param_post: 于后交互的相关参数
|
||
*
|
||
* str: url信息
|
||
*
|
||
*/
|
||
-(void)gateway:(id)mv func:(SEL)returnFunc
|
||
obj:(NSMutableDictionary*)obj_do obj_post:(NSMutableDictionary*)param_post STR:(NSString*)str HTTPMethod:(NSString*)_method
|
||
{
|
||
SGGatewayApi* api = [[SGGatewayApi alloc] init];
|
||
[api gateway:mv func:returnFunc obj_post:obj_do obj_post:param_post STR:str HTTPMethod:_method];
|
||
SG_RELEASE(api);
|
||
}
|
||
|
||
//使用介绍
|
||
/*
|
||
NSMutableDictionary* obj_do = [[NSMutableDictionary alloc] init];
|
||
NSMutableDictionary* obj_post = [[NSMutableDictionary alloc] init];
|
||
[obj_post setObject:@"123" forKey:@"i"];
|
||
[obj_post setObject:@"get_group_pic" forKey:@"t"];
|
||
[[SGGateway defaultGateway] gateway:self func:@selector(ReturnInfo:) obj:obj_do obj_post:obj_post STR:@"" HTTPMethod:@"Get"];//POST
|
||
-(void)ReturnInfo:(NSMutableDictionary*)obj_do
|
||
{
|
||
}
|
||
*/
|
||
@end
|