07 2013 档案

摘要:安装后第一次运行软件时,系统会弹出提示用户是否允许软件获取当前位置,如果用户不允许的话,之后运行时系统不会在弹出提示设置,这点很不方便,有个解决办法是给用户一个选项,调出iphone中“设置”定位服务选项,由用户手动设置,调用系统“设置”中定位服务相关代码如下:-(IBAction)btnSetting:(id)sender{ NSURL*url=[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]; [[UIApplication sharedApplication] openURL:url];}还有其他调用系统设置的 阅读全文
posted @ 2013-07-25 15:21 小白猪jianjian 阅读(6261) 评论(3) 推荐(1)
摘要:1.通过下面方式可以获取图片的像素颜色点:- (void*)getImageData:(UIImage*)image{void* imageData;if (imageData == NULL)imageData = malloc(4 * image.size.width * image.size.height);CGColorSpaceRef cref = CGColorSpaceCreateDeviceRGB();CGContextRef gc = CGBitmapContextCreate(imageData,image.size.width,image.size.height,8,im 阅读全文
posted @ 2013-07-08 17:32 小白猪jianjian 阅读(2592) 评论(0) 推荐(0)
摘要:凡是用get方法的,url里含中文的,都需要调用上面的函数进行编码。要不然会被当成二进制截断。//URL编码+(NSString*)urlEncode:(NSString*)str{intlength = [strlengthOfBytesUsingEncoding:NSUTF8StringEncoding];constchar* buffer = [strUTF8String];NSMutableString* returndata = [NSMutableStringstring];for(inti=0;i<length;i++){unsignedcharch = (unsigned 阅读全文
posted @ 2013-07-04 11:16 小白猪jianjian 阅读(4800) 评论(0) 推荐(0)
摘要:该控件有旋转,缩放,拖动,剪裁的功能,封装成了一个ImageCropperView类需要导入的库:QuartzCore.frameworkImageCopperView.h#import @protocol ImageCropperDelegate;@interface ImageCropperView : UIView { UIImageView *imageView; id delegate;}@property (nonatomic, retain) UIImage *image;@property (nonatomic, retain) UIImage *crop... 阅读全文
posted @ 2013-07-03 19:28 小白猪jianjian 阅读(2860) 评论(1) 推荐(0)