-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Displaying grid outside viewDidLoad possible? #153
Comments
I am afraid to suggest that your understanding of iOS view controller But let’s go back to app design and figure out what it is supposed to do. You can very possibly keep the data and not erase or destroy it even when Sample code or project code welcome. On 2012-08-24, at 3:38, TomWhitson notifications@github.com wrote: In my viewDidLoad I create a gridview set size, colors etc and assign So what I saw is that the various datasoure methods are called, and this Has anyone implamented the loading of a grid outside of viewDidLoad, if so Any feedback appreciated... — |
Hi, it could well be that I misunderstand...new to iOS and trying to learn. So my psuedo-code is, viewDidLoad{
} aSyncCallBack{ So this is what i am trying to achieve, async call in viewDidLoad and then reloadData in the async delegate callback. So it seems ok to me...but perhaps i am missing something?? As i said the grid does not show up to begin with when we call reloadData but if we click a cell or change tabs back and forth then it shows up. Thanks in advance for the ideas. |
One pattern that might work is to have something that loads data into a On 2012-08-24, at 18:32, TomWhitson notifications@github.com wrote: Hi, it could well be that I misunderstand...new to iOS and trying to learn. So my psuedo-code is, viewDidLoad{
} aSyncCallBack{ So this is what i am trying to achieve, async call in viewDidLoad and then As i said the grid does not show up to begin with when we call reloadData Thanks in advance for the ideas. — |
Hmm so I tried something like that, start the data load, load some dummy data, then reload when the new data arrives. This provides some even more strange behaviour though as far as I can see. When I load the dummy data it is fine, I load 8 cells with images and title, all displays as it should. Seems to me like an issue with reuse of cells? But as far as I know I did everything expected when creating the cell,
I allocate the image outside the if(filledCell == nil) so that the image is changed even on reuse, so it seems to me that is ok. Is there any setting I should be looking into which changes the ideas around reuse/relayout? |
In my viewDidLoad I create a gridview set size, colors etc and assign delegate/datasource to self but at present there is no data to display. This is pulled from the web at a later date, thus when I get my callback I would like to populate the grid outside viewDidLoad simply by adding data to the appropriate array and calling reloadData. If I try this it seems that the grid is not displaying until I interact with it or switch tabs and back.
So what I saw is that the various datasoure methods are called, and this causes various AQGridView calls to be made (I put logs in layoutsubviews and the like), but my screen stays blank for the time being. If I then change tab and back again I don't see any logs from within AQGridView but my grid appears as I expect.
Has anyone implamented the loading of a grid outside of viewDidLoad, if so any tips? Or should this work "out of the box" and I am missing something....what could iOS be calling when switching tabs back again? I have tried variuos calls such as setNeedsLayout/Display but nothing seems to work.
Any feedback appreciated...
The text was updated successfully, but these errors were encountered: