Table Cells from Core Data
Posted 06 October 2010 - 09:06 PM
Can Sensible Table View help with this situation? Any hints on how this is done (I already have CoreData setup and I have the objects in the table, however they display the wrong text in the cell, and when clicked it displays the other fields in the object, as the example video tutorial shows).
Any help or guidance will be appreciated.
Posted 07 October 2010 - 01:18 AM
What you're describing sounds almost identical to the Core Data sample app we ship with STV. Would you please post your class definition code, in addition to which attribute you would like to appear as the cell's text? Thanks!
Posted 07 October 2010 - 01:34 AM
Here is the Class definition:
SCClassDefinition *userDef = [SCClassDefinition definitionWithEntityName:@"User" withManagedObjectContext:managedObjectContext withPropertyNames:[NSArray arrayWithObjects:@"firstName",@"lastName",@"userId",nil]]; SCPropertyDefinition *firstNamePropertyDef = [userDef propertyDefinitionWithName:@"firstName"]; firstNamePropertyDef.title = @"First Name"; firstNamePropertyDef.type = SCPropertyTypeTextView; SCPropertyDefinition *lastNamePropertyDef = [userDef propertyDefinitionWithName:@"lastName"]; lastNamePropertyDef.title = @"Last Name"; lastNamePropertyDef.type = SCPropertyTypeTextView; SCPropertyDefinition *userId = [userDef propertyDefinitionWithName:@"userId"]; userId.title = @"userId"; userId.type = SCPropertyTypeNumericTextField;
I would like "$FirstName $LastName" to appear as the attribute. However when clicked I'd like it to display a UIView with a WebView or ScrollView based on what row was selected.
Posted 07 October 2010 - 03:02 AM
... userDef.titlePropertyName = @"firstName;lastName"; ...
To provide custom behavior when the cell is tapped, please refer to the following post: http://www.sensiblec...action.html#557
Hope this helps
Posted 07 October 2010 - 03:24 AM
- (void)tableViewModel:(SCTableViewModel *)tableViewModel didSelectRowAtIndexPath:(NSIndexPath *)indexPath
How do I get the User object that the indexPath.row corresponds to?
Posted 13 October 2010 - 09:08 PM
- wizgod likes this
Posted 15 October 2010 - 01:02 AM
1- If you're creating the cells yourself, all you need is set the SCTableViewCell "editable" property to FALSE.
2- If you're using an SCArrayOfObjectsCell or SCArrayOfObjectsSection, all you need is set the "allowDeletingItems" property to FALSE.
Hope this helps!
- wizgod likes this
Posted 17 October 2010 - 04:38 PM
Another thing, does SCT support easy indexing (e.g. A-Z on the right hand side of the screen, like in the Contacts app)?
Posted 18 October 2010 - 04:18 AM
tableModel.sectionIndexTitles = [NSArray arrayWithObjects:@"A", @"B", ..., @"Z", nil];
(please check our Core Data sample application, under the "People" tab)
Alternatively, you can have STV automatically generate the section index titles by setting tableModel.autoGenerateSectionIndexTitles = TRUE (will only generate index titles for sections present in the table view).
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users