last day (14 days later) » 

5:52 AM
3
A: Expandable UITableView cells showing datas

Arun GuptaYou don't even need to use expandable/accordion in this case. Here is how you can tackle this. Lets says your cell size when normal is 40 and when particular clicked is 100. In heightForRowAtIndexPath you can check which cell is selected and return more height if(selectedRow == indexPath.row) {...

 
nice! so where should I add the match information? (like team1[selected_cell], team2[selected_cell] etc. ? bewtween beginupdates and endUpdates ?
 
You just need to reload the selected cell and change its height in heightforRow... Are you creating your cell dynamically? You need to create your cell with all elements just change its height on selection deselection to show or hide the match details.
 
I have all the match details saved in arrays, so basically all the cells will be the same. When i select cell1, it will show details for that cell (match), when I select cell2 it will show match2 details, and so on...
should I do this with interface builder? create some textfields and retrieve the content from the arrays?
 
Absolutely. Let me see if get time to saw a sample to you.
Just check the sample demo at github.com/quantumarun/Demos/tree/master/ExpandTableCellDemo. This is just a basic concept you have to make changes to it for your requirement.
 
I'm using objective-c :D
 
5:52 AM
Its easy to convert it. Do you still want me to make changes?
 
i will now try your solution. If you just could update the answer adding the info about the match details values (retrieve it from the arrays etc.) I will accept it. thanks!
could you please convert it objective-c? it's just that the question is related to objective-c. thanks!
so I tried your solution. it is almost working except for the "Outlets cannot be connected to repeating content". That's why I wrote cell.team1.text = [teams objectAtIndex:indexPath.row]; but it seems that I cannot use this in dynamic prototype cells
 
 
2 hours later…
7:45 AM
hey!
 
8:12 AM
so I don't know if you understood my problem
 
 
2 hours later…
9:45 AM
Can you rephrase it
 
i have
cell.team1.text = [teams objectAtIndex:indexPath.row];
and so on, for team2, score, etc.
but i get "Outlets cannot be connected to repeating content"
 
10:03 AM
Can you show me your storyboard and where are you trying to connect your outlet to
Lets take the items of one cell. That will MatchName, Team1, Team2, Score... For this we have created a customCell.
So we have created outlets from prototype cell to customCell class
 
on it
for now i just have "team1" label
i'm going to upload some screenshots
 
ok.. so is this outlet not working?
 
10:19 AM
well not really
i got the error "Outlets cannot be connected to repeating content"
 
Can you show your customclass... This is some kind of glitch with storyboard mostly. Delete all the outlets and connect again
 
Looks Fine. Delete all the outlet and connect again.
Have you set the class in storyboard cell to CustomCell?
 
10:47 AM
Just like above Top Right.. i have updated the class for UITableViewCell to customCell
 
11:14 AM
yes I have
i'll try to delete the outlet
now the "team1" outlet doesn't appear in the outlets
is this because the "team1" outlet is declared in "CustomCell.h" and the scene where I'm trying to show it references to "MatchListViewController" ?
should I have to do some "import "CustomCell.h" ?
I already done that in "MatchListViewController.m"
well i just saw that my "CustomCell" files aren't appearing in Xcode
I did git pull and they were downloaded
but for some reason they are not appearinbg in xcode
i'll try to fix this before
 
It will be better if you create a sample project without git and try to make this sample
 
now I have the customcell files
but the team1 outlet is not appearing
 
You may need to set or connect the outlet again
 
11:29 AM
with ctrl-drag ?
becuase it is not appearing in the available outlets
 
Ctrl+drag to customCell.h
 
it is working man
you are the man!
thanks!!!
 
:)
Please accept the answer if it helped
 
yes!
thanks!!
 
12:09 PM
hey
i'm sorry
but I see that you are a pro with ios
i'd like to ask you another question if i could
so I have lots of matches
each one with
team1
team2
final score
date
the scorer
I have a dropdown where the user will select the season (2015-2016, 2014-2015 etc)
depending on the season
I will show the matches in the tableview
and when clicking on one
with team1 team2, final score, date and scorers
should i use NSDictionary, a json, something else?
because it's lot of datas
or something like
2015[total_matches_in_the_year][4] = {
{"aaa", "bbb", "1-0", "15-02-2015"},
{"ccc", "ddd", "2-2", "10-03-2015"},
...
}
and then when selecting the year, show the labels team1, team2, score, date
and then
team1 = selected_year[current_row][0]
team2 = selected_year[current_row][1]
...
 

last day (14 days later) »