[Solved] How to zoom image by slide? [closed]

2 things to do: Configure the slider so that its min and max values are equal to the min and max zoom scale of your scroll view Use [imageScrollView setZoomScale:sender.value]; to update the zoom when the slider is changed Also, check the superview that your slider is added to. It shouldn’t be added to the … Read more

[Solved] How to convert data string to json object and string in iOS?

Use this NSString *str=@”{\”Data\”: [{\”ID\”:\”1\”,\”Name\”:\”Raj\”},{\”ID\”:\”2\”,\”Name\”:\”Rajneesh\”}]}”; NSMutableDictionary *dict=[NSJSONSerialization JSONObjectWithData:[str dataUsingEncoding:NSUTF8StringEncoding] options:kNilOptions error:nil]; NSMutableArray *dataArr=[dict valueForKey:@”Data”]; for (NSDictionary *userData in dataArr) { NSLog(@”Id:%@ Name:%@”,[userData valueForKey:@”ID”],[userData valueForKey:@”Name”]); } 0 solved How to convert data string to json object and string in iOS?

[Solved] i have json data given below and i want to display it in a table

In your .h file take NSMutableArray : @property (nonatomic, retain) NSMutableArray *employeeData; in .m file @synthesize employeeData; Then Make Necessary changes in your code. -(void)getEmpData { self.employeeData=[[NSMutableArray alloc] init]; NSData *jsonData = @”Your Json Data”; NSDictionary *jsonDictionary = [NSJSONSerialization JSONObjectWithData:jsonData options:kNilOptions error:&error]; NSArray *arrDepartment = [jsonDictionary objectForKey:@”Departments”]; NSArray *arrEmployees = [[arrDepartment objectAtIndex:0] objectForKey:@”Employees”]; self.employeeData= [arrEmployees … Read more

[Solved] Unable to solve the error “[__NSCFBoolean length]: unrecognized selector sent to instance”

Your issue is with this line: NSURL *U1 =[NSURL URLWithString:[dict objectForKey:@”img”]]; The problem is caused by the fact that you assume: [dict objectForKey:@”img”] is returning an NSString when in fact it is returning an NSNumber representing a boolean value. You need to either figure out why the data in the dictionary is incorrect or you … Read more

[Solved] Objective-C Bug this class is not key value coding-compliant for the key dateAMPM [closed]

Take a look at the storyboard. You still have the dateAMPM and the dateLabel outlets tied to the initial view controller. you actually have to right click on the first icon on the top and manually delete the connection (click on the cross), where the yellow warning sign displays. . solved Objective-C Bug this class … Read more

[Solved] how to rotate an image in different direction using single button?

try this, here yourImage is the image view which is to be rotated – (IBAction)rotateImage:(UIButton *)sender // your button action method { if (!sender.selected) { [sender setSelected:YES]; [UIView animateKeyframesWithDuration:2.0 delay:0.0 options:UIViewKeyframeAnimationOptionCalculationModeLinear animations:^{ [UIView addKeyframeWithRelativeStartTime:0.0 relativeDuration:1/3.0 animations:^{ yourImage.transform = CGAffineTransformMakeRotation(2.0 * M_PI / 3.0); }]; [UIView addKeyframeWithRelativeStartTime:1/3.0 relativeDuration:1/3.0 animations:^{ yourImage.transform = CGAffineTransformMakeRotation(4.0 * M_PI / 3.0); … Read more

[Solved] Why is this NSDate not formatting properly? [duplicate]

Note that in console you’re seeing 0000 timezone, which means UTC, while your UI works on system default timezone (yours). This is because debug console uses description method, that formats date to UTC, you might want to add something like NSLog(@”%@”, [formatter stringFromDate:pick.date]); so that you’re seeing exactly the same thing in UI and console. … Read more

[Solved] How to push or present UIViewcontroller or storyboard from UIView subclass?

You need to implement protocol method for custom UIView class. For example; #import <UIKit/UIKit.h> @protocol YourCustomViewDelegate <NSObject> – (void)buttonTapped; @end @interface YourCustomView : UIView @property (nonatomic, strong) id< YourCustomViewDelegate > delegate; @end And the .m file you can call buttonTapped delegate method. – (void)myCustomClassButtonTapped:(id)sender { [self.delegate buttonTapped]; } For proper work; set your custom view … Read more