Is it advisable to write to a plist from a UITableView didSelectRowAtIndexPath:? - iphone

I have a UITableView and am wondering if it's advisable to write to a plist file after a user selects a row in a table. Basically the user selects a row (or many) and then touches an APPLY button and the plist would be updated recording which rows have been selected by the user.
thanks for any help or advice

Yes, You can do this.
I don't think there's any problem with this.
However, make sure you don't overwrite it. As in clear it first and write it. Or, it might cause a conflict in your logic.

Related

UITalbeView need to delete row that might be reordering

No, my code is not crashing by just deleting content, or reordering content, that works fine.
The issue is, the content is connected to a pusher service and it might need to delete a row at any point, even while reordering. I have been looking around for some time and I haven't found a way to:
Cancel the reordering of the cell when delete is needed (it goes
blank / clear).
Avoid any actions from a deleted cell when it finishes
'reordering'.
Tell if the table is reordering the cell before I need to
delete it.
So in short I need to delete a cell that might be reordering from a UITableView.
Have you faced a similar issue?
Anyways, I found a way to do it. Here's the logic just in case anyone ever needs it.
Prevent the cell's movement with the use of tableView:targetIndexPathForMoveFromRowAt:
On delete control don't call [yourTableView].deleteRows, call reloadData
Looks like that's it.
Thanks

load information after login objective-c

I have a login page with two button one for facebook login one with email and pass login,after login I will load some information in table, my question is what is the best way to load this information, create two .xib file tableView for each login, or just one .xib file.
Thanks in advance!
I would suggest the following solution :
1 create a second view, call it something like ListVC.xib.
2 in ListVC add a member NSMutableArray called listData.
3 in your first window, said loginVC.xib, each of your button will load data in an NSMutableArray, each in its own way. then each open ListVC.xib, and set listData member to the array it just load.
If you use this solution, or something close, you will not create 2 ViewController, with nearly the same code. Basically, copy and pasting your code is bad. If you need to modify it, it will become much more complicated.

Text field re-enter word

Good afternoon. I would like to know if there is a method that makes the text-field capable of "remember" what the user wrote the previous times, so when the user writes the first letter a list with the proposed words will appear!! :) Thanks!
It can possible to show the list of values in tableview. you can use autocomplete.
Read this article. and also with source code. This will help you.
Sample image
Not that easy, you will have to do some modifications, for example you will need to store in an NSMutalbeArray all the value inserted, then you will have to present a table when the user starts to edit the UITextField this will change as the user writes
as your app runs, there will be many text that you need to remember/store that it will come to the point that your text that you have to remember will grow to size. you can store your text to a local database (sqlite), then as the user writes on the text field, do a search query and return the data.
unless you dont want to remember the text entered when the user used and exited/quit your app.

Write from textfield to array for uitableview objective c iphone

What i want to do is have a textfield on the screen and a table below it, when the user enters something into the textfield, i'd like to write that value into an existing array, which is being used to populate the table? Can someone help me out with this one please?
Thanks alot
Not typically the place for people to write code for you.
That said, here's an example.
http://drop.io/blnnhnt/asset/example-zip
Notes:
- Uses Core Data to demonstrate persistent store.
- Uses standard UINavigationController, with two dynamically added UIBarButtons

save checked items in table view for later reuse in iPhone

Got a conceptual question: If I got a tableview with about 100 items and the user can check as many as he wants from that list, how and where do I save the checked status of each individual item for later reuse?
In your own internal structures. UITableView isn't a database. It merely is an interface to your data. Any selection, deletion, addition, etc. will have to be handled by your code and stored. Typically you have some sort of a database or structure associated with the UITableView elements. When you get a check action, you can update a variable in that structure.
For an example of an SQL database backed UITableView app, see here.
For storing the checked elements of tableview, you have to maintain your code in didselectRow mthos of tableview. So, whenever you check the tableview row you can save it in an array. And save that array in the "NSUSerDefaul". So, that whenever you close the application, you can get back your selected tableview row array from "NSUserDefault". Or you can use sqlite database but it is better to use NSUserDefault as there is simple thing to do.
Please give your response if you find any problem.
You can use NSUSerDefault in your application from the following link: click here