UA-17470720-3

Jump to content


Photo
- - - - -

STV 3.0: Adding customCells to SCArrayOfObjectsSection

sections core-data

  • Please log in to reply
4 replies to this topic

#1 mgcds

mgcds

    Jr. Member

  • STV Lite
  • PipPip
  • 10 posts
Reputation: 1
Good

Posted 20 February 2015 - 10:27 AM

Hi all,

 

i am stucked with following situation.

 

In my table i created an SCArrayOfObjectsSection mySection, bound to the object who´s attributes i want to show. I only have one cell in this section. Since this cell has to be customized i overwrite the mySection.sectionActions.cellForRowAtIndexPath-block to return my customCell.

 

Now i expect that when the user clicks on this cell a view with each of the attributes from the bound object is shown.

This works, but i need to extend this.

 

The bound object has an array of lets say Car objects.

 

My first problem is that i don´t understand how to show "several" cars. If it would only be one attribute, then it would be the standard functionality but i have an array with several cars.

So I need that at the end of the newly displayed attributesList, each Car object is displayed in its own cell.

My second problem is that  i need to customize this added car-cells, since they have to show all the attributes (4 attributes) of "Car" in the same cell, and not display a "new view" where the car attributes are shown.

 

If you think that i approached this problem wrongly and should do it completely different your criticism is welcomed.

Thank you very much for your help.

 

Cheers

Max



#2 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 20 February 2015 - 05:09 PM

the section of "cars" that you want to list, you will want to set expandContentInCurrentView

that way they will list in the current section

Then return a custom cell to display the car items

 

you would then also want to look into the add new cell, if you were allowing users to add more cars, and to set that cell to show in detail view

 

i would not personally have users edit 4 properties in the detail view.. i would have they tap the item and then edit props in the edit view


  • Tarek likes this

P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.


#3 mgcds

mgcds

    Jr. Member

  • STV Lite
  • PipPip
  • 10 posts
Reputation: 1
Good

Posted 23 February 2015 - 10:55 AM

Hi Ozie,

 

thank you very much for your answer. I could advance a lot with this. Now each "car" is being shown in its own custom cell as i needed. It´s not necessary for the user to be able to create or edit the fields it was just necessary to show the information on the cells. I unchecked the "user interaction enabled" radio button so the user is not able to drill into the fields. I still have one last problem and it´s that i didn´t find a way to remove the "arrow" on the right hand of the customCell showing that the cell is available for drilling in

http://postimg.org/image/woyoojthx/

 

could you suggest how to remove it?

 

Thank you!

Max

 

 



#4 wizgod

wizgod

    I'm what you guys call a User

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 575 posts
  • LocationThe Grid
Reputation: 149
Popular

Posted 23 February 2015 - 12:27 PM

Greetings Program!

 

in the cellActions.willConfigure set the accessoryType for the cell:

 

cell.accessoryType = UITableViewCellAccessoryNone;

 

Wg


  • Tarek likes this

P.S. I love Swift... talk Swift.. Never too old school to learn yet another programming language. LOL! ;-)


#5 mgcds

mgcds

    Jr. Member

  • STV Lite
  • PipPip
  • 10 posts
Reputation: 1
Good

Posted 24 February 2015 - 07:48 AM

@WG Great, I was needing that. I´m slowly understanding how the framework works.

Thanks for your help!

 

Cheers

Maxi







Also tagged with one or more of these keywords: sections, core-data

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users