Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 8, 2013, 04:25 AM   #1
Mvkoe
macrumors member
 
Join Date: Aug 2008
Location: Belgium
Custom TableViewCell action?

Hey

The question that I have is how is this "thing" called: (See figure 1)

So basicly when the user tap the + next to the 1 option in the TableView. Then the information come's underneath it in the tableview. the + changes into a -.

This is the process, and i want to know how this is called, it's not really a dropdown menu, because it's populating the TableView.

Figure 1:
Mvkoe is offline   0 Reply With Quote
Old Jan 8, 2013, 07:35 AM   #2
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
It's been years since I did anything fancy like this with UITables, but if I recall correctly there's a data source method that dictates whether a row should show a +, -, both, or neither during editing. There's also a delegate method that is called when the + or - button is pressed.

I suspect that they have it set up to initially show a +, then when you press that + it inserts the two rows with animation, and changes the edit mode of the row from + to -. The table would be in edit mode the whole time. Alternatively, it's possible they just stuck in their own UIButton with the + sign and change it to a - at the right time.
ArtOfWarfare is offline   0 Reply With Quote
Old Jan 8, 2013, 07:45 AM   #3
Mvkoe
Thread Starter
macrumors member
 
Join Date: Aug 2008
Location: Belgium
Quote:
Originally Posted by ArtOfWarfare View Post
It's been years since I did anything fancy like this with UITables, but if I recall correctly there's a data source method that dictates whether a row should show a +, -, both, or neither during editing. There's also a delegate method that is called when the + or - button is pressed.

I suspect that they have it set up to initially show a +, then when you press that + it inserts the two rows with animation, and changes the edit mode of the row from + to -. The table would be in edit mode the whole time. Alternatively, it's possible they just stuck in their own UIButton with the + sign and change it to a - at the right time.
And is it possible to add value's between other value's in my Array ?
Like i would have an array:
Person 1 +
Person 2 +

to:
Person 1 +
Things about person 1
Person 2 +
Mvkoe is offline   0 Reply With Quote
Old Jan 8, 2013, 08:49 AM   #4
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Yes, it is possible.

If you're looking for more help with it, I suggest you start posting some code where you attempted to do this and we can point out mistakes you made.
ArtOfWarfare is offline   0 Reply With Quote
Old Jan 8, 2013, 09:17 AM   #5
dejo
Moderator
 
dejo's Avatar
 
Join Date: Sep 2004
Location: The Centennial State
Quote:
Originally Posted by Mvkoe View Post
And is it possible to add value's between other value's in my Array ?
Like i would have an array:
Person 1 +
Person 2 +

to:
Person 1 +
Things about person 1
Person 2 +
Sure, it's possible. But it seems to me that what your table is showing, based on the above example, is people. Without each row expanded, you're showing only minimal information for each person. When a row is expanded (through the use of an accessoryView button), you include more detailed information about that person in the row. Is that the case?

If that's true, I would have an array of Person (model-class instances) as your data-source and then your unexpanded rows show only basic properties of the Person and expanded rows show more. You might need a parallel array to keep track of which rows are expanded.
__________________
dejo is offline   0 Reply With Quote
Old Jan 8, 2013, 11:32 AM   #6
Mvkoe
Thread Starter
macrumors member
 
Join Date: Aug 2008
Location: Belgium
Quote:
Originally Posted by dejo View Post
Sure, it's possible. But it seems to me that what your table is showing, based on the above example, is people. Without each row expanded, you're showing only minimal information for each person. When a row is expanded (through the use of an accessoryView button), you include more detailed information about that person in the row. Is that the case?

If that's true, I would have an array of Person (model-class instances) as your data-source and then your unexpanded rows show only basic properties of the Person and expanded rows show more. You might need a parallel array to keep track of which rows are expanded.
I would have a plist file where i load my data from. The real data is like this:


So an NSDictonary that hold's my Categories, and in each categorie there is an array of strings.
Mvkoe is offline   0 Reply With Quote
Old Jan 8, 2013, 12:44 PM   #7
dejo
Moderator
 
dejo's Avatar
 
Join Date: Sep 2004
Location: The Centennial State
Quote:
Originally Posted by Mvkoe View Post
I would have a plist file where i load my data from.
Load the plist into your model layer. Then access from there.

I still think you are trying to bite off more than you can chew. You need to concentrate on the fundamentals right now. Have you finished that book yet?
__________________
dejo is offline   0 Reply With Quote
Old Jan 8, 2013, 01:13 PM   #8
Mvkoe
Thread Starter
macrumors member
 
Join Date: Aug 2008
Location: Belgium
Quote:
Originally Posted by dejo View Post
Load the plist into your model layer. Then access from there.

I still think you are trying to bite off more than you can chew. You need to concentrate on the fundamentals right now. Have you finished that book yet?
I'm always trying to think a bit further then I can handle, so I can learn from the things I want to acomplish. And yeah kinda done with the book

So I already have my data categories in my Tableview, so in did select row, or an button, it should load the data from the array categorie and show it under the categorie like a "dropdown" menu.

Can't you push me in the right direction of how need to handle this ?
Mvkoe is offline   0 Reply With Quote
Old Jan 8, 2013, 01:28 PM   #9
dejo
Moderator
 
dejo's Avatar
 
Join Date: Sep 2004
Location: The Centennial State
Quote:
Originally Posted by Mvkoe View Post
I'm always trying to think a bit further then I can handle, so I can learn from the things I want to acomplish.
Nothing wrong with that.

Quote:
And yeah kinda done with the book
Kinda done? What does that mean?

Quote:
So I already have my data categories in my Tableview, so in did select row, or an button, it should load the data from the array categorie and show it under the categorie like a "dropdown" menu.

Can't you push me in the right direction of how need to handle this ?
Have you considered using a drill-down approach rather than a drop-down?

By the way, I'm a little confused. First you were talking about Persons and now you are talking about Categories.
__________________
dejo is offline   0 Reply With Quote
Old Jan 8, 2013, 01:34 PM   #10
Mvkoe
Thread Starter
macrumors member
 
Join Date: Aug 2008
Location: Belgium
Quote:
Originally Posted by dejo View Post
Nothing wrong with that.


Kinda done? What does that mean?



Have you considered using a drill-down approach rather than a drop-down?

By the way, I'm a little confused. First you were talking about Persons and now you are talking about Categories.
With kinda done i mean, i'm done with the things that are meant for me, so no iCloud, iPad, drawing Quartz stuff.

Yea sorry i'm confusing you, the persons thing was an example from the screenshot, and that not really has to do with categories that I want. I just want the drill-down menu ?

Correct me if i'm wrong. I'm thinking something like this:

Code:
didSelectRowAtIndex -> get label, search for that key string in my dictionary and get those value's -> Drill that down under the first categorie that it searched for?
How can i accomplish that drill-down ?
Mvkoe is offline   0 Reply With Quote
Old Jan 8, 2013, 05:57 PM   #11
dejo
Moderator
 
dejo's Avatar
 
Join Date: Sep 2004
Location: The Centennial State
Quote:
Originally Posted by Mvkoe View Post
Correct me if i'm wrong. I'm thinking something like this:

Code:
didSelectRowAtIndex -> get label, search for that key string in my dictionary and get those value's -> Drill that down under the first categorie that it searched for?
How can i accomplish that drill-down ?
You pretty much have the pseudo-code here. Now it's just a matter of translating that into actual code.

P.S. When you say "get label" be careful not to try to get the actual UILabel that is displaying the text in the cell. Instead, you'll want to retrieve this value from your datasource.
__________________
dejo is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Resolved: custom font for Custom UITableViewCell erdinc27 iPhone/iPad Programming 5 Apr 18, 2014 12:50 PM
Best Course of Action for Broken 5 Greenmustard iPhone 0 Sep 17, 2013 04:54 PM
Springtomize 2 Custom Time Mode - Custom String GUILTIE Jailbreaks and iOS Hacks 10 Mar 7, 2013 03:18 PM

Forum Jump

All times are GMT -5. The time now is 07:19 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC