ios5

Using Core Data and in insertMethod App crashes and give NSInternalInconsistencyException with error message Context already has a coordinator

非 Y 不嫁゛ 提交于 2020-01-23 02:35:10
问题 i am implementing a core data example in xcode 4.2 at insertMethod (in MasterViewController.m class) my app crashes with a NSInternalInconsistencyException and error message: Context already has a coordinator; cannot replace. can any buddy tell me the meaning of this exception and error message insert method given below:- (void)insertNewObject { detailViewControllerObj = [[DetailViewController alloc]initWithNibName:@"DetailViewController" bundle:nil]; detailViewControllerObj.delegate = self;

AVCaptureSession is not giving a good photo quality and good resolution

自作多情 提交于 2020-01-22 07:35:11
问题 I'm working with AVCaptureSession for capturing the image. Its working fine but not giving a good resolution. I compared it with the image captured by iPhone Camera and I found that the iPhone Camera Image is much better than AVCaptureSession image. I have seen 3-4 links on stackOverflow about this but could not find any solution. also I have tried all the presets AVCaptureSessionPresetPhoto, AVCaptureSessionPresetHigh, AVCaptureSessionPresetMedium, AVCaptureSessionPresetLow,

Asynchronus for loop in iphone

放肆的年华 提交于 2020-01-22 03:21:10
问题 the for loop looks like this , which i have written in view did load, so it takes more time to load this page. for (int i=3; i<[[[[dataDict objectForKey:@"rss"]objectForKey:@"channel"]objectForKey:@"item"]count]; i++) { if (i%3==0) { x=0; y++; } view=[[UIView alloc]initWithFrame:CGRectMake((x*250)+5, (y*404)+6, 244, 400)]; [view setBackgroundColor:[UIColor whiteColor]]; view.layer.borderColor=[[UIColor whiteColor]CGColor]; view.layer.borderWidth=1.0; view.layer.cornerRadius = 5; view.layer

Error : CoreData: error: Failed to call designated initializer on NSManagedObject class 'Product'

白昼怎懂夜的黑 提交于 2020-01-21 07:15:26
问题 I start to use core data with ios 5. I have my product model : Product.m : #import "Product.h" @implementation Product @dynamic category_id; @dynamic label; @dynamic price; @end Product.h : #import <Foundation/Foundation.h> #import <CoreData/CoreData.h> @interface Product : NSManagedObject @property (nonatomic, retain) NSString *category_id; @property (nonatomic, retain) NSString *label; @property (nonatomic, retain) NSString *price; @end I try to parse an xml with a custom class using

Getting image name of iphone photo library

╄→尐↘猪︶ㄣ 提交于 2020-01-21 06:13:34
问题 I'm doing a project to take images from iphone photo library or in other way from camera roll. I have done that without any problem. But i need to retrieve the name from the photo library. Is there a way to do that? Any help is appreciated Thanks 回答1: Have a look at ALAssetsLibrary which is available in iOS 4.0 and later. Also, these links may help How to get a photo's original filename in iOS? iPhone: How do I get the file path of an image saved with UIImageWriteToSavedPhotosAlbum()? 回答2: If

Issues with custom font in iOS

烈酒焚心 提交于 2020-01-21 06:04:30
问题 I followed the steps outlined in various locations using the UIAppFonts property list key. I'm using the Aller Light font. I've added it as a resource, added the font name correctly in the info property list, and am now attempting to use it, however every attempt to do so results in the default font being displayed. So far I've tried: [leader setFont:[UIFont fontWithName:@"Aller Light" size:20.0]]; [leader setFont:[UIFont fontWithName:@"AllerLight" size:20.0]]; [leader setFont:[UIFont

How to check network 2G or 3G in IOS? [duplicate]

我是研究僧i 提交于 2020-01-21 02:09:13
问题 This question already has answers here : How do I know whether my iPhone/iPad is connected to 2G or 3G? [duplicate] (3 answers) Closed 6 years ago . I want to check if the device has a 2G or 3G connection. I used Reachability class for network connection check. 回答1: In iOS 7 Apple provided a new way to get it. Please read this link. The "Know your Radio" section. The basic idea is to use the new currentRadioAccessTechnology added to the CTTelephonyNetworkInfo class. If you want to get

scrollViewWillEndDragging:withVelocity:targetContentOffset: not working on the edges of a UISCrollView

牧云@^-^@ 提交于 2020-01-20 20:06:45
问题 I'm trying to implement a custom tab bar which is scrollable and has paging at each tab bar item. For that i'm using the delegate scrollViewWillEndDragging:withVelocity:targetContentOffset: which works perfectly with one problem. The way my paging works is, if the contentOffset is near the right item, it the targetContentOffset changes to the offset of that item. Same thing for the left side. The problem is, whenever I'm at at the left half of the first item and the right of the last (the

scrollViewWillEndDragging:withVelocity:targetContentOffset: not working on the edges of a UISCrollView

倾然丶 夕夏残阳落幕 提交于 2020-01-20 20:06:29
问题 I'm trying to implement a custom tab bar which is scrollable and has paging at each tab bar item. For that i'm using the delegate scrollViewWillEndDragging:withVelocity:targetContentOffset: which works perfectly with one problem. The way my paging works is, if the contentOffset is near the right item, it the targetContentOffset changes to the offset of that item. Same thing for the left side. The problem is, whenever I'm at at the left half of the first item and the right of the last (the

Using CoreImage to filter an image results in image rotation

岁酱吖の 提交于 2020-01-19 10:13:16
问题 Thanks for reading. I'm trying to use CoreImage in iOS 5 to alter the appearance of an image. The problem is that the existing image appears to lose its orientation information during the process and ends up rotated by 90 degrees. Here is the code: CIContext *context = [CIContext contextWithOptions:nil]; CIImage *img = [CIImage imageWithCGImage:imageView.image.CGImage]; CIFilter *adjustFilter = [CIFilter filterWithName:@"CIHighlightShadowAdjust"]; [adjustFilter setDefaults]; [adjustFilter