[Solved] Int Value from MainViewController to UIImageView Class [closed]

The answer given by JoeFryer is one idea or else you can also use NSNotificationCenter. It works as below. Put this in ImageviewController Tap Action. [[NSNotificationCenter defaultCenter] postNotificationName:@”countUp” object:nil userInfo:nil]; Put this in MainViewController‘s ViewDidLoad method. [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(increaseCount) name:@”countUp” object:nil]; and also this method -(void)increaseCount{ //Here You can increase the count count++; } Hope … Read more

[Solved] Access Data Variable from one class in another class

In SecondViewController.h @property (nonatomic, copy) NSString *textblah; In FirstViewController.m #import “SecondViewController.h” // where you want to store value SecondCiewController *secondViewController = [[SecondViewController alloc] init]; secondViewController.textblah = stringToStore; // and [self.navigationController push:secondViewController animated:YES]; // You can log the set value with to check whether it was successful or not. NSLog(@”textblah: %@”, textblah); For complete understanding of … Read more

[Solved] List Document Files in IOS [closed]

1) Apple prefers that downloaded data be stored in the app’s Caches directory since the data can be replaced if it is deleted. 2) Yes, if a user deletes an app, all data stored in the app’s sandbox will be deleted. What would you expect to happen? 3) Use NSCachesDirectory. 4) /Users is not a … Read more

[Solved] Objective-C “Star Wars” opening crawl [closed]

It is possible in Objective-C. Only because I’m nice We’ll start with a simple rotation and see what happens. If you build, you’ll see that we got a nice rotation but it doesn’t look realistic. We need to skew the perspective as well to get the real effect. UITextView *textView = [[UITextView alloc] initWithFrame:self.view.bounds]; [textView … Read more

[Solved] how to get server response and if server response is “Success” after show alert by JSON using objective c [closed]

Try This Don’t need to use JSON simply try this code to get response from server NSString *string= [[NSString alloc]initWithFormat:@”url”]; NSLog(@”%@”,string); NSURL *url = [NSURL URLWithString:string]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; [request setHTTPMethod:@”POST”]; NSURLResponse *response; NSError *err; NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err]; NSLog(@”responseData: %@”, responseData); NSString *str = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; NSLog(@”responseData: … Read more

[Solved] Objective-c: simple strings (beginner) [closed]

If all the displays are UILabel objects, then change this word = [NSString stringWithFormat:@”%@ %@ %@ %@ %@ %@ %@ %@ %@”, display1, display2, display3, display4, display5, display6, display7, display8, display9]; toword = [NSString stringWithFormat:@”%@ %@ %@ %@ %@ %@ %@ %@ %@”, display1.text, display2.text, display3.text, display4.text, display5.text, display6.text, display7.text, display8.text, display9.text]; solved Objective-c: simple … Read more

[Solved] Hide custom cell image

Create UITableViewCell.h and .m file. Create some variable like UILabel and UIImageView object in files and make it IBOutlet and bind them with cell .xib file. Inside UITableView implementation, and in “cellForRowAtIndexPath” you can use that custom UITableViewCell class object and use that synthesize variable of UILable and UIImageView and use it to show or … Read more