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 9 years ago.
Improve this question
I have problem about accessing class, and i ve been looking for solution, couldnt figured out yet.
I have 3 classes:
1 - ViewController
2 - XmlParser
3 - AllDeals,
When i open app, ViewController uses XmlParses class, and XmlParser class parses xml file and stores information into NSMutableArray in the XmlParser Class.
I would like to access that NSMutableArray(in XmlParser class) and all information that it stored already from AllDeals class. I cannot split up Xml file again. it s taking too much time.
When i tried to access nothing comes. I have tried many things.
How am i gonna point or access that class or NSMutableArray...
Thank you for your helps.
Have you tried to use shared instance of XmlParser Class ? If Not then make shared instance whenever you want to use this class and access that NSMutableArray with the help of XmlParser Class shared instance.
if you're aware about the delegates then you can pass values over delegate at the success of your parsing else create one NSMutableArray into your 1-ViewController globally and take advantage of it by passing the parent of viewController to XmlParser then you'll have filled NSMutableArray of your desired output and access it further more.
Related
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 8 years ago.
Improve this question
Good night!
Should I use the method - (void) dealloc in file ViewController.m for outlets (where #synthesize is announced at the beginning of the file) that do not have properties retained?
In ARC, you do not need to implement dealloc other than to release resources managed outside of ARC (retained properties are managed by ARC). If you have a property that managed outside of ARC (say a malloced object), you need to free it in the dealloc method (preferably by setting it to nil and handling the freeing in the setter).
If you do implement dealloc, do not call super as you do when not using ARC.
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 want to have the ability to allow the user to fill out a profile, almost like the notes app and then when they are done it adds it to the UITableViewCell and displays certain parts of what they filled out on the Cell..Then they can obviously repeat this action..
I am not sure where to look for a tutorial on this or what this may be called, anyone have any suggestions?
Five simple steps :
1)Design how form is gonna look like and your tableview.
2)Make the form using a sample UIviewcontroller layout your components using xib or
storyboard
3) Embed your UIViewcontroller designed in step 2 into a UINavigationViewController
This helps you to transition from your form to UITableView
4) Design your UITableViewController and put a back button on UINavigationBar to allow user to go to previous view controller.
5) Connect UIViewController to UITableViewController
-(void)submitButtonPressed:(id)sender{
UITableViewController *tvc = [[UITableViewController alloc] initWithNib:#"your view controller name"];
// pass data to UITableViewController
tvc.userdata = self.userdata;
[self.navigationController pushviewController:tvc];
}
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
passing response data from one class to another class
//i want to pass "reside:15" to another View controller.
2013-08-16 14:29:57.273 blabby[1432:1a603] Login response:{"response":"success","resid":15}
add an class
Constant.h
in constant.h
take an string like
NSString *str;
import constant class into your class and than str =your response data;
and use it into another class.
This is an NSDictionary. As with any NSObject, you can make it a property of source view controller and access it in another view controller.
Read it in detail: Coordination between View Controllers.
create a dictionary in the view controller you want to hold that data,while pushing that view controller you can take that data and use it.It is called as design patterns.
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 9 years ago.
Improve this question
I have a SPObject class, which is a custom NSObject. In the viewDidLoad method of the ViewController, I am creating an instance of SPObject. There is also a button which, on clicked, creates a new SPObject.
When my app goes to the background, I want to save these SPObjects in the database. So, in the applicationDidEnterBackground method, I am getting the instance of the main ViewController using
ViewController * vc = (ViewController *)self.viewController;
I want to know how I can get a list of the current SPObjects in the next line of the above line.
If what I wanted was a list of UIViews, I could have just done,
for(UIView * subView in vc.view.subviews)
which would have returned a good list.
How can I do this?
Have an array property of your objects:
#property (nonatomic, retain) NSMutableArray *objects;
When you create new object add it to this array:
[self.objects addObject:newSPobject];
When entering background get this array:
NSMutableArray *objects = vc.objects;
Now you can do with this array whatever you like
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Since there is no pre-existing component for creating a combobox (or select box) as seen on webpages through Safari, can someone provide an example or pre-existing 3rd party component of creating one?
I don't think this is hard to do.
In a view controller you have a UITextField and a UITableView. Assign the view controller to be the delegate of the both controls, plus the data source of the table.
Implement the UITextField delegate method textField:shouldChangeCharactersInRange:replacementString: in your controller. This intercepts the changes as they are being typed in your text field. In this method, iterate through your list of possible options and store the matches in an NSMutableArray instance variable on your view controller. Then call [myTableView reloadData].
Have your table cells generated from the array of matches you previously stored.
It should be pretty straightforward and shouldn't take much code at all beyond a few delegate methods to get working.