ios5

Using CoreImage to filter an image results in image rotation

梦想与她 提交于 2020-01-19 10:06:38
问题 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

Using CoreImage to filter an image results in image rotation

烈酒焚心 提交于 2020-01-19 10:05:59
问题 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

App crashes after running a method in background thread

大兔子大兔子 提交于 2020-01-17 09:39:13
问题 I am recoding the main screen in which we can drag images. I have a setneedsdisplay method which slows down the dragging of objects. But when i call the same method in the background thread the issue is solved but the app crashes. Also if there is any other option to record the video without calling the drawRect: method again and again? - (void) drawRect:(CGRect)rect { NSDate* start = [NSDate date]; CGContextRef context = [self createBitmapContextOfSize:self.frame.size]; CGAffineTransform

NSMutable Array from One Class to Another Class in iPhone

前提是你 提交于 2020-01-17 08:07:20
问题 I have an NSMutable Array in FirstViewController class, I want to Pass that array to SecondViewController class. And I want to use that in SecondViewController class. I am doing this in Xcode 4.2.1 with ARC... How can I...? and what are the attributes i want to use when setting property... (OR) Explain me using Appdelegate files also... 回答1: There are two ways to do this. 1: Make a property for NSMutableArray in appdelegate, set the value for array in FirstViewController and retrieve value in

NSMutable Array from One Class to Another Class in iPhone

时光总嘲笑我的痴心妄想 提交于 2020-01-17 08:06:09
问题 I have an NSMutable Array in FirstViewController class, I want to Pass that array to SecondViewController class. And I want to use that in SecondViewController class. I am doing this in Xcode 4.2.1 with ARC... How can I...? and what are the attributes i want to use when setting property... (OR) Explain me using Appdelegate files also... 回答1: There are two ways to do this. 1: Make a property for NSMutableArray in appdelegate, set the value for array in FirstViewController and retrieve value in

How to handle freezing programm at loading xml from bad url?

☆樱花仙子☆ 提交于 2020-01-17 07:55:28
问题 I want to handle freezing my program, when it load an xml from bad address. I tryed it with using @try and @catch, but it doesn't work. Can I use some alternative handling? @try{ NSString *test=[[NSString alloc] initWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@:%@",addressLabel.text,portLabel.text]] encoding:NSUTF8StringEncoding error: nil]; } @catch (NSException *ex) { NSLog(@"Bad IP address"); return; } 回答1: Run your XML Parser in NSThread and use

Transformation unable to perform twice

China☆狼群 提交于 2020-01-17 04:29:26
问题 I have this function, -(void)transitionstar{ star.hidden = NO; star2.hidden = NO; star3.hidden = NO; star4.hidden = NO; star5.hidden = NO; star6.hidden = NO; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.4f]; [UIView animateWithDuration:0.0 animations:^{ CGAffineTransform scale = CGAffineTransformMakeScale(1, 1); CGAffineTransform rotate = CGAffineTransformMakeRotation(360.0); CGAffineTransform rotate2 = CGAffineTransformMakeRotation(-360.0); CGAffineTransform

Transformation unable to perform twice

青春壹個敷衍的年華 提交于 2020-01-17 04:29:04
问题 I have this function, -(void)transitionstar{ star.hidden = NO; star2.hidden = NO; star3.hidden = NO; star4.hidden = NO; star5.hidden = NO; star6.hidden = NO; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.4f]; [UIView animateWithDuration:0.0 animations:^{ CGAffineTransform scale = CGAffineTransformMakeScale(1, 1); CGAffineTransform rotate = CGAffineTransformMakeRotation(360.0); CGAffineTransform rotate2 = CGAffineTransformMakeRotation(-360.0); CGAffineTransform

UIAlertview message not Showing properly

流过昼夜 提交于 2020-01-17 03:18:06
问题 I'm having a UIAlertView and declared as UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"NEW_ALBUM" message:@"ENTER_ALBUM_NAME" delegate:self cancelButtonTitle:@"CANCEL" otherButtonTitles:@"Ok",nil]; alert.tag = 999; alert.alertViewStyle = UIAlertViewStylePlainTextInput; [alert show]; [alert release]; the resultant alert was shown as 来源: https://stackoverflow.com/questions/19288340/uialertview-message-not-showing-properly

XCode png compression issue

做~自己de王妃 提交于 2020-01-16 19:50:15
问题 During testing i found some thing strange in Xcode. I have a png of size 2.2 mb and the png compression is "YES" in the build setting after archive i extract the build and found that Xcode converted the png to 3.8 mb. Then with same test and png compression is "NO" in build settings then the image have same size of 2.2 mb. Is Xcode extend the size of PNG afte compression ?? 回答1: In all of my own apps, I keep PNG compression set to OFF as Apple has traditionally had problems dealing with