I've been searching and can't find an answer anywhere. I want to a create a really simple grouped table view for "settings" of my app. User taps a button and I want to load a UITableView that has 3 or 4 cells in categories. Is there a way to just set one up in IB without the dynamic code building (ie. cellForRowAtIndexPath).
Note: Most answers I have found pertain to storyboard, which I am not using.
No, you can't. tableView:cellForRowAtIndexPath: is the way a table gets its data -- there's no way to populate a table without that in iOS (in OSX you can use bindings, but they're not available in iOS).
If you only need a few cells, are you sure you need to use a table?
Related
still learning iOS development, want to create something like mention friend likes in Facebook / Instagram.
Mention People UI in Instagram
Is it using new TableViewController and add subview to the same View Controller? (in this case, CommentViewController) , but, when i already have UITAbleViewController in my CommentViewController, how can i handle the second tableviewcontroller?
Looking at the image you provided it looks as though the best way to implement this would be a UIViewController that has a UITableView added to it. Each tableview that is created can have a delegate and datasource set for it. When the textview detects that a mention is being entered (more about detecting this later) you would trigger a second tableview to appear as an additional view (subview) that overlays your current tableview (or as the accessory view of the keyboard, the way apple and others present a textview over the keyboard for text entry ex: messages app).
In order to manage the two tableviews my suggestion would be to create two additional classes each of which conform to the UITableViewDelegate and UITableViewData source. The first one would be the CommentsTableViewManager and the second would be the MentionsTableViewManager. The first tableview would set the CommentsTableViewManager as its delegate and datasource while the second would use the MentionsTableViewManager.
The other problem you may run into later on is determining how to properly detect mentions being typed into the textview. I've actually created an open source library that will help you with this problem. It's located here: https://github.com/szweier/SZMentionsSwift the README should provide enough information for you to get started if you choose to use it.
I hope the information about helps get you started with your app.
From architecture prospective it's way better to have a single table view with altered data source container, depending on current mode.
Speaking an instagram way - either you're showing comments, or, if # symbol was detected, displaying a list of users. So almost all your UITableView's delegate and data source methods will start with something like if (isMentionMode) and you'll choose specific cell class/cell's height/amount of rows per section/etc depends on isMentionMode state.
With iOS 7 Apple suggest to use UIDatePicker and UIPickerView inline within UITableViewCell as showed here: iOS 7 - How to display a date picker in place in a table view?
I have a table view with N rows dynamically allocated. Each row represent an object fetched from Core Data. What I want is display an UIPickerView just below each row the user tapped in to let user select in a range of values.
I've thought to adopt Apple's way and insert an UIPickerView every 2 rows but this it's pretty weird and causes some issues. How can I 'follow' the normal succession for retrieving each object from my main NSArray _list which contains each object fetched from Core Data?
Is there a 'better' way to implement this without having to insert tons of UIPickerView?
This is an image which explains better, I hope.
Take a good look at the sample code you linked to. You don't insert a picker every other row. There is one picker that appears just below the input row you're editing. The picker only appears during editing.
After you read their code, maybe you could ask a more specific question...?
I want to add in an iOS App a list with 3 columns, but I also want that each field could be editable on the fly by clicking directly on it and when I press return it saves the field.
Currently I am using Xcode 4.6.1 and storyboard.
Here is the idea:
Because I am a beginner, I am asking you if there is a way to do that by using the UITableViewCell, UITextField and UITextView or there is something else to create this list faster.
Can you provide me some links with tutorials or similar, please?
Another question is: because each field (Label1,1; Label1,2; L1,3) will refer to the same object (eg.: cable; [size]1 meter; [diameter]1 cm), is it better to put each row in a NSMutuableArray or put everything in a SQLLite Database?
Hope in some hints.
You can create custom cell. I answered how to do it here
And add gesture recognizers for each object on the cell.
Change values and reload data.
I am re-phrasing an earlier question and re-posting. I made the original question too complicated; I understand how the set up a TableView and get files to drop into it. What I don't understand is; How do I get two NSTableViews on one interface and get the contents to display in what ever table I choose? For eample, I want to drag files/folders into the first TableView, and when I double click on one, I want the contents of the file/folder to display in the second table.
Thanks
Provide the two table views with two different dataSource delegates, or, in the single dataSource object observe the UITableView address that's passed on every call.
Im using a navigation controller and a normal view. In the view I'd like a UIPickerView with custom values in it. It would have one column with about 15 values in it. And I want the ability to add an action to each value.
Is there any way I can do this using Xcode? I can't seem to find the corrent help.
Cheers.
You need to look at the documentation for UIPickerViewDelegate.
In order to have an action for each value you will implement pickerView:didSelectRow:inComponent: and have a different action based on which row was selected.
For the contents of the rows you can implement pickerView:titleForRow:forComponent: if your contents are simple text.
If you want custom drawn contents you can provide a custom view for each row with the pickerView:viewForRow:forComponent:reusingView: method.
See the UICatalog example that is available in the iPhone Developer examples.