CopyPastor

Detecting plagiarism made easy.

Score: 0.8002217411994934; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2013-02-28
by Rushabh

Original Post

Original - Posted on 2011-08-10
by Robin



            
Present in both answers; Present only in the new answer; Present only in the old answer;

- (void)viewDidLoad { [super viewDidLoad]; // do something...... UIImage *croppedImage = [self imageByCropping:[UIImage imageNamed:@"SomeImage.png"] toRect:CGRectMake(10, 10, 100, 100)]; } - (UIImage*)imageByCropping:(UIImage *)imageToCrop toRect:(CGRect)rect { CGImageRef imageRef = CGImageCreateWithImageInRect([imageToCrop CGImage], rect); UIImage *cropped = [UIImage imageWithCGImage:imageRef]; return cropped; }
I think i can provide a better solution to that large amount of code.
- (void)viewDidLoad { [super viewDidLoad]; // do something...... UIImage *croppedImage = [self imageByCropping:[UIImage imageNamed:@"SomeImage.png"] toRect:CGRectMake(10, 10, 100, 100)]; } - (UIImage*)imageByCropping:(UIImage *)imageToCrop toRect:(CGRect)rect { CGImageRef imageRef = CGImageCreateWithImageInRect([imageToCrop CGImage], rect); UIImage *cropped = [UIImage imageWithCGImage:imageRef]; return cropped; }


        
Present in both answers; Present only in the new answer; Present only in the old answer;