Create UIPopOver without including Tableview in ios - objective-c

I want to create two PopOvers when at the time button clicked and textField clicked in the same UIView (not ViewController). In those popovers I need to load separate array values. Is there any way to create them and added to UIView?
I already added one tableview for base UIView, so without using tableviews, how can I create UIpopOvers and load the arrays in those popOvers? How to handle the selected rows?

This link can help you to create a popover menu.
Or you can take an UIImageView having shape of popover menu and table view in that, it will be easy to load arrays and to handle selected rows.
I did the same using second method.
Happy Coding!

Related

How to add UITableView to one of several subviews using storyboard

I have one UIViewController with two UIViews on it. In the Navigation bar, when one button is pushed one of the UIViews is displayed and when the other button is pushed the other UIView is displayed. I want to put a UITableView on one of the views. However, the UITableView requires the UIViewController to use the UITableViewDelegate and UITableViewDataSource. Having implemented this for my UIView (subview) containing the UTTableView, when I click on the button for the other view, which does not contain a table, I get errors and the application croaks.
I am assuming (possibly incorrectly) that my issue is that I am trying to use the same UIViewController for both subviews, but only one contains a table.
Question 1) Is it possible to do what I described above? Meaning, if I had a problem then something was not connected up correctly.
So, I went down a path of creating two separate UIViewControllers; one for each view. Not sure this is the smart approach. Now I am just looking for advice on the best way to do this. Thank you in advance for your help.
To be more clear about what I am trying to do. I want the blue view to be put where the pink view is when the first button on the bar is clicked and I want the yellow view to be put where the pink view is when the second button is clicked. Essentially the pink view will never be displayed and may not even need to be on the UtilityViewController.
Having each as a UIViewController (or a subclass thereof) is the way to go about what you are trying to do. The UITabBarController does this already: https://developer.apple.com/library/ios/documentation/uikit/reference/UITabBarController_Class/Reference/Reference.html

How to update UITableView after adding/ updating data

I am newbie for iPhone application. For storing data, I am following this tutorial.
I understand how to save data and retrieve the same.
What I am wanted to do is instead of another UITableViewController (first screen in storyboard, where we have list), I will drag a UITableView and show list of items there instead of showing in another screen.
Any idea/ suggestion how to get this done?
Any hints would be greatfull.
What I feel is, I would need to add UITableView. Add delegate and dataSource method on it and add a method where I will have all data shown in UITableView.
Edit 1
What I want is ONLY ONE SCREEN. In the link that I have provided, it is second screen.
That should work fine. But make sure you also have done a
[tableview reloadData];
after you've changed the data in your table view data source delegate.
What I am wanted to do is instead of another UITableViewController (first screen in storyboard, where we have list), I will drag a UITableView and show list of items there instead of showing in another screen.
Why you want to do this way?
UX will not be at best.
What I feel is, I would need to add UITableView. Add delegate and dataSource method on it and add a method where I will have all data shown in UITableView.
Even if you want to do, yes you need to set delegate and datasource methods.

UIPicker and UITableView in iOS

I am new to iOS and confused about the right way to implement UIPickerView.
I have a UITableView (the list of which is populated by XML File). Now I want to implement an option to trim down that list (say, show only type X or type Y). Now the confusion is, should I implement the PickerView in TableView itself, or make a new segue to show PickerView.
I tried implementing the first one but couldn't get it working.
A picker view wouldn't really fit inside a table view. You should have a button on the navigation bar or toolbar on your table view controller which presents a modal view controller holding your picker view.
This would then feed the selected value back to the table view controller (via a custom delegate protocol method, or similar) and the table view can filter its rows.

Where is my NSTableView in NSScrollView?

Why in Xcode 4 (i don't kwow in 3.2) when i drag and drop a table from interface builder it became NSScrollView? Where is NSTableView??? (NSTableView in NSScrollView)
How can i access NSTableView from NSScrollView?
How can i add a row, delete, customize and RELOAD DATA?
Why if i do
for (id obj in scrollView.subviews)
NSLog(#"obj: %#", obj);
i don't able to get NSTableView description?
thanks.
XCode automatically embeds the table in a scroll view for you. To select your Table View you can either slowly double click on the Scroll View, press control+shift and click on the Scroll View, or click the right-facing triangle under the vertical objects in the XIB to reveal every object in the XIB.
You can access it programatically by calling [scrollView documentView], because it is technically a subview of the ScrollView's Content View (an instance of NSClipView)
To populate your table view you can provide content by hooking up a data source, or by binding its table columns to an array controller.
It's kind of complicated, you should probably take a look at the Documentation
To access the tableview just connect the tableview with the code (IBOutlet NSTableview *yourTableview) then access it easily like [yourTableview reloadData]; Dont bother about the scrollview
Inside "Bordered Scroll View" there is a "Clip View" and inside there is a "Table View". This one you need to connect with your code.

difference between presentModalView and addSubview?

When revealing a new view, what are the differences between these two and when would you use each?
Also, what's the right way to nest views. for example, I have a UIImageview that animates onto my view and it has a button on it. I want to put that image and the button in their own view, then simply animate the view and have both handled simultaneously.
Thanks!
For the first question :
presentModalView is you show another viewcontroller (called modalViewController) to get some data, temporary view... (more about ModalViewController here) . Generally, it is another view and can hide your original view
addSubview: you add another view in your current screen, you don't show another view. Which means you are still in your current viewController.
For the second question:
I will go for presentModalViewController here. You can create another UIViewController contains a UIImageView and 2 buttons then you can just present it