UIPicker view issues [closed] - iphone

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have one picker view on screen 1 once i select component from picker view. selected item display on screen 2 navigation bar title. How can we achieve pleas help me.
Array[abc,xyz,cde,ope];
Thanks

You need to pass the selected value to the next view controller and set the selected values as a navigation bar title.
Create a NSString Instance in view controller 2
viewcontroller2.h
#property(nonatomic,retain)NSString *title;
In view controller 1 before navigate to viewcontroller2 you need to set the selected view to the viewcontroller 2 title instance (one kind of sending value to next view)
Viewcontroller1 :
ViewController1 *view1 = [[ViewController1 alloc] init];
view1.title = pickerSelectedString;
[self.navigationController pushViewController:view1];

Related

Swift: Navigation Bar is not a button [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 months ago.
Improve this question
Hiii !
it's my second app on Xcode.
I noticed that my navigation item is not a button but a "drop down" and I don't know why
How can I change it ? Image: navigation item
So from the comment, I will answer detail about your problem for futher reader and yourself.
As Swift there is two types of tranfering to from view controller to another view controller
First one is using presentViewController which is presents a view controller modally. Just like from your image and we usually use it for task you don't want user to navigate from so just two methods cancel or continue. Example: Sign In, Sign Up, ...
Second one is using pushViewController which will have a Back button just like you want in the navigation bar. And in this case you can control your own controller, callback, ... Remember to define what is root view controller by using Embed in Navigation controller if you use storyboard or define by code by using
UIApplication.shared.windows.first?.rootViewController = vc // your view controller
What you're dealing with is that your storyboard or screen is as a sheet.
Segue set as Page Sheet
Changing this to full screen will give it a bar, but you may need to embed the scene into a navigation control to create a bar. You can do that via Editor -> Embed In -> Navigation Controller.
Segue set to full screen
Embedded into Navigation Controller
The navigation controller color is set to black to be noticeable.

Linking the Tab View to its file [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am trying to experiment with Tab Views in swift. I've created a tab in the StoryBoard and linked it up correctly. I also set up the file by selecting the Cocoa Touch Class and the UIViewController option. My question is how do I link the file with the view so that it works like how the others do?
Go to the storyboard and select the Tab view controller on your storyboard. In the identity inspector set the class to Your ViewController class.

how to call object from one class to another class [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 9 years ago.
Improve this question
hi i am new to iphone. what i did is creating two classes named view1 view2. And i create a button in view1. now what i need is when ever i click the button in view one it goes to viewdidload in view2 how can i done this pls post some code or link. thank u
You're violating principals of MVC. Views should never talk directly to one another. If you need to signal some change in one view upon some event from another view, you need to route it through your controller.
I.e., a push of a button might change a label. In this case, the button receives an event (touches up or whatever) which get routed through its delegate (some controller). This delegate can then signal some action which then changes the text of the label (the second view).
I strongly suggest you become acquainted with the model-view-controller paradigm. It will give you insight into how the frameworks are constructed, and enable you to better write code targeting these frameworks.

switching between views in iphone programming [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
View Controllers: How to switch between views programmatically?
i want to go to another view from one view on a button click
please help me........
thank you
Use a UINavigationController to display the first view. When the user taps your button, call the navigation controller's pushViewController:animated: method. To return to the previous view programmatically, call one of the pop...ViewController... methods (though this may not be required, since the navigation controller itself can handle "back" button taps).
If you don't want to use the uiNevigationController then use:
[self.view addSubView:objectOfSecondPage.view];
and add this on the back button in the next page
[removeFrom SuperView];

iphone app information page [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
What is the best way of displaying an information page in an iphone app? Anny ideas will be very helpful. I would prefer to keep all info within iphone app so as not to make it internet connectivity dependant..
Set up a "home" view controller as the root view controller of a navigation controller.
From here, set up a button or tab to trigger pushing an "information" view controller onto the navigation stack.
In the "information" view controller, use a UITableView to organize sections and table cells that drill down to further details.