How to implement a large grid of cells in an iPhone application? - iphone

In reference to my previous question, I would like to know how to implement a large grid of cells in an iPhone application.
I'm working on an interface which would be similar to an Excel spreadsheet, with many rows and columns. Do I have to handle each cell separately? How can I handle user interaction in each cell?
Is there a standard way to create this type of control?

There is no real standard mechanism.
If all of the cells in a given row will always fit in the width of the screen, one way to do it would be to create a UITableViewCell with several UILabels and vertical separators between them. If all of these rows had "columns" of the same width, you would get the appearance of a grid.
If that isn't possible, it might be helpful to think about what the table view control truly is. A table view is just a scroll view that automatically adds, removes, and recycles its subviews so that only the ones that are visible at a given time are in memory. There is no reason you could not write a GridView control that did the same thing, but in two dimensions. It wouldn't be as easy as using the built-in table view, of course, but if the table view can't do what you need, well, that's why Apple isn't writing all the apps.

Sounds like the exact thing that UICollectionView was made for!
http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UICollectionView_class/Reference/Reference.html

Look at my answer to this question: MS Excel type spreadsheet creation using objective-c for iOS app.
Basically there's no standard way to do this. You will need to made everything by hand and there's 3 ways to go:
Use a UIWebView and layout everything using html/js.
Modify a UICollectionView.
Make everything by hand using Core Data.

Related

implement periodic table like grid layout in iphone app?

i am just developing some simple app which show the periodic table but my problem is how can i achieve the periodic table like layout in my iPhone app in just landscape format.
i have tried to search some CustomGridLayout sdk for IOS but not suitable for me
have goggled the things but not succeeded
following is the reference of periodic table layout which i want to implement
There is a couple way to do this:
1) You may use UICollectionView with custom cell. for this.With cell size equal element cell. But you will hit a several problem here: Some cells should be disabled, and customized in non standard way. In this case section is not useful for you. Overlay button in top on collection view may be difficult to positioning in storyboard.
2) You can use UIContainerView with totally custom view and colors. Dynamically added to custom row and column. This ofc have some flaws. Harder to build layout in storyboard (compared to (1) solution), memory management issues.

iOS Grid View with support for different sized cells

I'm an iOS developer looking for a solution to a tricky problem.
I need to create a grid view/ mosaic view to layout cells of different sizes (both width and height).
I basically need the functionality of a GMGridView, with horizontal scrolling/paging, the ability to edit, and drag cells to new locations, thus rearranging the entire grid view. I've looked at all of the current open source grid views out there, and found none with variable sized cells.
One solution I have thought about is 2 tableviews both rotated for the horizontal scrolling, and then intercept some UITableView scrolling methods, to then scroll the other tableview together. This is not ideal, as I will be unable to move a cell from one view to another, and I'm not sure how happy apple will be about it.
I also know of some possible (confidential?) support for this coming in the next version of iOS, but would like to keep my app supporting previous versions of iOS.
Thanks for any insight you can provide.
I realize this post is kind of old, but here is a list of relevant projects: *https://github.com/betzerra/MosaicUI
*https://github.com/betzerra/MosaicLayout
GridViews on iOS are a pain. Fortunately Apple is coming up with UICollectionViews that are optimized to build grids. This is coming in iOS6 and it's still under NDA so check out the documentation on Apple's website for more information.
The question you need to solve now is whether you want iOS5 retro-compatibility or not

iOS Get Values of Controls in UITableViewCells

So, I'm a bit of a noob to iOS (PHP dev). I have a UITableView in a UIViewController. The cells consist of a combination of any of three different custom prototype cells. Which cells are loaded is based on a service that loads the questions and types. One has a segmented control with 2 choices, another with 8 choices and the third has a UITextView to receive a comment. This is essentially a survey. I can grab the values of the controls as they are answered, but I'd like to be able to just gather them up when the 'submitResponses()' method is called as an action attached to the 'Submit' button.
Any ideas? Should I be going about this in another way?
The "correct" way to do this is definitely to collect the data as it is entered!
One of the biggest problems with the approach that you suggest is that for larger tables it simply won't work because if a table view cell is off the screen, you can't access it or the controls/views that it contains (and it may not even exist yet!).

iPhone - Table/Grid Data

For an iPhone app, I'm going to need to display read-only tabular data in a grid format. This data could potentially have many rows and columns.
I could use UITableView, but the problem is the data will most likely be very wide and require scrolling.
Is there a way to put a UITableView in a UIScrollView and allow zooming and scolling x and y, but still take advantage of reusable UITableView cells? I assume putting a huge UITableView in a UIScrollView would not take advantage of the cell reuse (virtualization).
Or am I better off using UIWebView and a HTML table?
A webView with HTML tables would likely use more memory, but end up being a lot easier to code and debug than 2D cells inside a tableView inside a scrollView.
Another option for a really large table might be a tiled scrollView where you only render the visible tiles (and release and/or reuse the offscreen tiles).
If you're still looking for a native solution, you might consider this iOS data grid - even though it's not free, it's quite full featured.

Generate View for iPhone application using interface builder.?

I wanted to generate one fix view using interface builder, but the size of that view is exceeding the size of iphone screen,and I am not able to maximize screen. I wanted to show table view in that screen.
I did enabled scrolling but that didn't work,
Update 1:
Actually I wanted to show thumbnail image inside cell and i want to show 5 cell so 5 thumbnail image,those images are static. So which is a better way to achieve this ,interface builder or programming?
Hope this is clear enough.
Your question is not terribly clear, so this is the question that I am attempting to answer here:
You want to have a table view which has five rows, each of which has a small image.
Short answer: you can't do this entirely in the Interface Builder. What you can do is define your table view, including the "look," scrolling abilities, etc. And then in the same XIB file you would define the table cells (which can include your pictures, captions and what have you).
You then have to connect the two together programatically. Apple provide plenty of examples in the SDK on how to do this.