02 2014 档案
摘要:// 获取当前所在的城市名 CLGeocoder *reverseGeocoder=[[CLGeocoder alloc] init]; [reverseGeocoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray *array, NSError *error) { CLPlacemark *placeMark = [array lastObject]; if (placeMark != nil) ...
阅读全文
摘要:Touch:在与设备的多点触摸屏交互时生成。响应者对象响应者对象就是可以响应事件并对事件作出处理。在iOS中,存在UIResponder类,它定义了响应者对象的所有方法。UIApplication、UIView等类都继承了UIResponder类这些类的实例都可以当作响应者。 第一响应者当前接受触摸的响应者对象被称为第一响应者,即表示当前该对象正在与用户交互,它是响应者链的开端。响应者链事件被交由第一响应者对象处理,如果第一响应者不处理,事件被沿着响应者链向上传递,交给下一个响应者。一般来说,第一响应者是个视图或控件,并且首先对事件进行响应,如果第一响应者不处理该事件,事件就会被传递给它的视图
阅读全文
摘要:首先,确保你已经关掉了openfire打开终端 (在应用程序-->实用工具-->)输入以下命令sudo rm -rf /Library/PreferencePanes/Openfire.prefPanesudo rm -rf /usr/local/openfiresudo rm -rf /Library/LaunchDaemons/org.jivesoftware.openfire.plist第一条会让你输入管理员密码,尽管你输入的时候,终端不会显示,不必担心,正确输入后按回车,它就执行了.三条命令以后,openfire就彻底消失了.
阅读全文
摘要:FMDBManager.h#import #import "FMDatabase.h"@interface FMDBManager : NSObject{ NSString *dataBasePath; FMDatabase * fmdbDataBase;//数据库对象 BOOL isFMDBopen;}+ (FMDBManager *)sharedFMDB;// 创建表-(void)createTable;// 插入记录-(void)insertTable;// 获取所有记录-(NSMutableArray *)getList;//删除某人所有信息-(BOOL)delet
阅读全文
摘要:NSMutableString *urlStr = [NSMutableString stringWithFormat:@"%@?",request.URL]; for (int i=0;i<[parameters count];++i) { (i==0)?:[urlStr appendString:@"&"]; NSString *key = [[parameters allKeys] objectAtIndex:i]; NSString *value = [[parameters allValues] objectAtInde...
阅读全文
摘要:NetWorkAPIClient.h#import #import "AFHTTPRequestOperationManager.h"#define POST_PATH @"/campus/dispatch.rpc"#define BASE_URL @"http://192.168.0.102:8080/idc/mobile/"//测试环境@interface NetWorkAPIClient : AFHTTPRequestOperationManager+ (NetWorkAPIClient *)sharedClient;@endN
阅读全文
摘要:#pragma mark - 获取讨论组成员- (void)getDiscussionMemberInfoWithSendIq:(discussionModel *)data{ NSXMLElement *iq = [NSXMLElement elementWithName:@"iq"]; NSXMLElement *getUsers = [NSXMLElement elementWithName:@"getUsers"]; [iq addAttributeWithName:@"id" stringValue:@"SPUT4
阅读全文
摘要:在ios7上UITableView底线右移了,我们可以通过添加代码来让它铺满整个屏幕的宽,在使用前要加上判断是否有这个方法if ([_tableView respondsToSelector:@selector(setSeparatorInset:)]) { [_tableView setSeparatorInset:UIEdgeInsetsZero];}
阅读全文
摘要:第一阶段- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ NSLog(@"程序启动");}- (void)applicationDidBecomeActive:(UIApplication *)application{ NSLog(@"加载完毕进入主页面");}第二阶段- (void)applicationWillResignActive:(UIApplication *)applica
阅读全文
摘要:加载过程第一步-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil第二步-(void)loadView第三步-(void)viewDidLoad第四步-(void)viewWillAppear:(BOOL)animated第五步-(void)viewWillLayoutSubviews第六步-(void)viewDidLayoutSubviews第七步-(void)viewDidAppear:(BOOL)animated卸载过程第一步-(void)viewWillDisappear:(BO
阅读全文
摘要:在苹果的api实现中,NSInteger是一个封装,它会识别当前操作系统的位数,自动返回最大的类型。当你不知道你的操作系统是什么类型的时候,你通常会想要使用NSInteger,所以或许你想要你的int类型范围尽可能的大,用NSInteger,32位系统NSInteger是一个int,即32位,但当时64位系统时,NSInteger便是64位的。
阅读全文
摘要:DayClass.h#import @interface DayClass : NSObject- (NSString *)dateToStr:(NSDate *)date;@endDayClass.m#import "DayClass.h"enum{ Sun = 1, Mon, Tue, Wed, Thu, Fri, Sat};@implementation DayClass- (NSString *)dateToStr:(NSDate *)date{ NSString *flagString = nil; // 当前日期 ...
阅读全文
摘要:UIImage+grayColor.h#import @interface UIImage (grayColor)+ (UIImage *)grayImage:(UIImage *)sourceImage;@endUIImage+grayColor.m#import "UIImage+grayColor.h"@implementation UIImage (grayColor)+ (UIImage *)grayImage:(UIImage *)sourceImage{ int bitmapInfo = kCGImageAlphaNone; int width = sourc
阅读全文
摘要:- (NSString *)intervalSinceNow: (NSString *) theDate{ NSString *timeString=@""; NSDateFormatter *format=[[NSDateFormatter alloc] init]; [format setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; NSDate *fromdate=[format dateFromString:theDate]; NSTimeZone *fromzone = [NSTimeZone systemTimeZo
阅读全文
摘要://改变图片颜色- (UIImage *)imageWithColor:(UIColor *)color{UIGraphicsBeginImageContextWithOptions(self.size, NO, self.scale);CGContextRefcontext = UIGraphicsGetCurrentContext();CGContextTranslateCTM(context, 0, self.size.height);CGContextScaleCTM(context, 1.0, -1.0);CGContextSetBlendMode(context, kCGBlend
阅读全文
摘要:NSMutableArray *array = [[NSMutableArray alloc]initWithArray: [self.navigationController viewControllers]]; // 删除栈中的一个viewcontroller [array removeObjectAtIndex:2]; // 清掉栈中的所有viewcontroller并跳到指定viewcontroller [array removeAllObjects]; pxViewController *px = [[pxViewController alloc]init...
阅读全文
摘要:XMPPRoom *room; // 初始化房间 XMPPRoomCoreDataStorage *rosterstorage = [[XMPPRoomCoreDataStorage alloc] init]; if (rosterstorage==nil) { NSLog(@"nil"); rosterstorage = [[XMPPRoomCoreDataStorage alloc] init]; } roomJID = [XMPPJID jidWithString:roomName]; room = [[XMPPRoom alloc] ...
阅读全文

浙公网安备 33010602011771号