删除没有引用的图片以减小打包体积 强大 : 支持iOS 和 Android项目 咨询 : 712641411 作者 : 吴海超 效果 推荐 iOS开发辅助Mac工具:DataModelFactory iOS平台最强大Sqlite库:ModelSqliteKit
为了在正式版发布前减少 iOS 系统的 Bug 数量,苹果计划为 iOS 操作系统推出公测项目。根据熟悉该计划的消息人士爆料,去年苹果为 OS X Yosemite 推出了相似的公测计划,苹果计划通过目前的
iOS 9 正式版将于9月16日发布,现在苹果向开发者发布了可能是最后的测试版 iOS 9 GM seed。除了 iOS 9 GM 外,苹果还发布了全新的 iOS 9.1 开发者测试版,iOS 9.1
· iOS中NSOperationQueue与GCD分派队列 我们已经知道iOS还提供了一种叫做NSOperationQueue的队列机制。就像分派队列一样,它也接受块作为参数并加入队列。你可能会问
一个UI事件,Timer call, delegate call, 都会是一个新的Runloop iOS有没有垃圾回收? Objective-C 2.0也是有垃圾回收机制的,但是只能在Mac OS X Leopard
#import "ViewController.h" @interface ViewController () @property(nonatomic,strong)UITextView *textView; @property(nonatomic,copy)NSString *BASE_URL; @property(nonatomic,copy)NSString *BASE_URL1_PARAM
简单的音乐播放 导入AVFoundation.framework - (void)viewDidLoad { [super viewDidLoad]; //路径 NSString* path = [[NSBundle mainBundle] pathForResource:@"xiguan" ofType:@"mp3"]; //路径->url NSURL* url = [NSURL fileURL
网络监听用到的类为Reachability.h,这个Xcode项目里面是不自带的,需要从github上面下载,在使用的时候记着导入SystemConfiguration.framework。 首先是在AppDelegate.m中设置网络监听 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reach
首先要先导入第三方类库FMdatabase。 获得存放数据库文件的沙盒地址。 +(NSString*)databaseFilePath [objc] view plaincopy { NSArray*filePath=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES); NSString*doc
IOS中对JSON格式的解析通常可以采用NSJSONSerialization来实现. 如,我们可以用个简答的HTTP请求的方式获取JSON数据,(以下都是在playground中写的) var
处理图片颜色 - (UIImage*)grayscale:(UIImage*)anImage type:(int)type{ CGImageRef imageRef = anImage.CGImage; size_t width = CGImageGetWidth(imageRef); size_t height = CGImageGetHeight(imageRef); size_t bitsP
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. UIImageView *imageView = [[UIImageView alloc] init]; imageView.frame = CGRectMake(0, 0, 80, 120); imageVie
NSDateComponents *_comps = [[NSDateComponents alloc] init]; [_comps setDay:23]; [_comps setMonth:3]; [_comps setYear:2014]; NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGre
1.保存在user Document文件夹下,以读取文件,写入文件方式 2.在工程里手动创建一个.plist文件,把固定的内容写入,这个需要人工手动写入(工程里只可读取,不可以写入) 3.保存在user Document下,不过不需要读写文件,用系统的 NSUserDefaults 可以快速保存添加读取删除基本数据类型 这里记录的是第1种,第2种就是创建一个plist文件,然后自己手动写入数据,再
iOS下的具体实现方式如下 新建一个类 继承 #import
// // ViewController.m // LocationDemo // // Created by LaughingZhong on 14/11/12. // Copyright (c) 2014年 Laughing. All rights reserved. // #import "ViewController.h" @interface ViewController () @end
CLGeocoder *myGeocoder = [[CLGeocoder alloc] init]; [myGeocoder geocodeAddressString:_searchBar.text completionHandler:^(NSArray *placemarks, NSError *error) { if ([placemarks count] > 0 && error == n
[CTSIMSupportGetSIMStatus() isEqualToString:kCTSIMSupportSIMStatusNotInserted] 可以判断是否插入了sim卡。 需要CoreTelephony.framework。 /** * 检测是否有SIM卡 * [CTSIMSupportGetSIMStatus() isEqualToString:kCTSIMSupportSIMS
@interface UIButton (AsyncImage) //size by point - (void)setImageFromURL:(NSString *)urlString adjustToSize:(CGSize)size completion:(void (^)(void))completion logo:(UIImage *)logoImage; @end @implemen
+ (UIImage *) imageFromView: (UIView *) theView { // Draw a view’s contents into an image context UIGraphicsBeginImageContext(theView.frame.size); CGContextRef context = UIGraphicsGetCurrentContext();