I am creating a code in which i want to pass integer value for one uiview to another view.In another uiview that integer value so as text of label.How make code for that?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- Popover segue to static cell UITableView causes co
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- didBeginContact:(SKPhysicsContact *)contact not in
You can pass it as integer value itself as u do in c or in any other language. In the second view, u can convert it to string with [NSString stringWithFormat:@"%d",intVal];
In second view, declare a NSUInteger variable , say NSUInteger _intVal.
In .h file, declare a method like
In .m file,
Now u can use the _intVal in the second view.
When you are going from view1 to view2 then do like this.
Take one variable in view2 and set the property as
in view2 .m file do this.
@synthesize val;
Then when you are adding the view2 as subview to view1 then
Take this in .h file in SecondViewController
Make below function in SecondViewController
Now In First view controller do like this:
Now, In secondViewController viewWillAppear Method write this.
Please check spelling mistakes as I hand written this. Hope this help.
If you are not using navigationContoller then you can do something like this.
declare a varable in .h file
declare a method like that:
when you set it, you use:
when you need it, use: