[Solved] ios different ways of calling a method from different classes [closed]

I don’t think it’s so awful a question. Lot of folks responded negatively to the “best” aspect of the question. A simple rephrase might be “what circumstances are best suited for each kind of inter-object communication”. In summary the common ones are as follows: Direct invocation (google Objective-C language methods) – Most common, most direct, … Read more

[Solved] Difference in writing a code [closed]

I also really don’t get your intention. However, viewDidLoad is called exactly once, when the controller is first loaded into memory. That’s the point where you usually want to instantiate any instance variables and build any views that live for the entire lifecycle of this view controller. Nevertheless, usually the view isn’t visible at this … Read more

[Solved] Exception in button tag

The reason you are getting an exception is because your tag is greater then the blogids count. Add the buttons to the array and then it will not crash. For example: blogids = [[NSMutableArray alloc]init]; [blogids addObject:oneOfYourButtons]; Also if you only want to see the tags number use this: NSLog(@”The tag clicked:%d”,tag); instead of: NSLog(@”The … Read more

[Solved] Delete all rows in a tableview [duplicate]

On the button action event remove all the objects from itemArray then reload tableView data. Before this make sure that in tableView delegate numberOfRowInsection you are passing itemArray count like that: – (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [itemArray count]; } // button action// -(IBAction)deleteTableViewData { [itemArray removeAllObjects]; [tableView reloadData]; } 3 solved Delete all rows … Read more

[Solved] how to fetch user facebook friends names,count and id in app? [closed]

You’ll only be able to get the friends which also use your app, and you’ll need the user_friends permission for that. Please read the docs first: https://developers.facebook.com/docs/apps/changelog#v2_0_login https://developers.facebook.com/docs/graph-api/reference/user/friends Quotes: Friend list is no longer part of the default permission set and has its own permission: Asking for access to a person’s friend list is now … Read more

[Solved] How to store data from string into array with delimiter [duplicate]

There you go: NSMutableString *response = [NSMutableString stringWithString: @” hr 123,124,125,126,127,128 hr st 234,235,236,237 st”]; [response replaceOccurrencesOfString:@” ” withString:@”” options:NSCaseInsensitiveSearch range:NSMakeRange(0, [response length])]; NSRange firstAppearanceOfHr = [response rangeOfString:@”hr”]; [response replaceCharactersInRange:firstAppearanceOfHr withString:@””]; NSRange secondAppearanceOfHr = [response rangeOfString:@”hr”]; NSString *hrString = [response substringWithRange:NSMakeRange(0, secondAppearanceOfHr.location)]; NSArray *hrArray = [hrString componentsSeparatedByString:@”,”]; NSLog(@”HrArray:%@”,[hrArray description]); NSRange firstAppearaceOfSt = [response rangeOfString:@”st”]; NSInteger … Read more

[Solved] How to call take picture method in IOS [closed]

You’ll want to take a look at the UIImagePickerController class which is what lets you access the camera functions of your iOS device. Specifically, you’ll want to use the source type UIImagePickerControllerSourceTypeCamera (first checking if the device has a camera via isSourceTypeAvailable:), with media type kUTTypeImage, present the camera controller via presentViewController, and you can … Read more

[Solved] Present a viewcontroller in UIView [closed]

To add a view controller to another view controller, you can do the following: Inside the parent view controller class: addChildViewController(someViewController) view.addSubview(someViewController.view) someViewController.didMove(toParentViewController: self) someViewController.view.translatesAutoresizingMaskIntoConstraints = false Then, set the layout constraints to position the view controller: NSLayoutConstraint.activate([ someViewController.view.leadingAnchor .constraint(equalTo: view.leadingAnchor ), someViewController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), someViewController.view.bottomAnchor .constraint(equalTo: view.bottomAnchor ), someViewController.view.topAnchor .constraint(equalTo: view.topAnchor ) ]) view.layoutIfNeeded() 2 … Read more