Hi,
I am trying to make a tableview list from core data which is working as expected.
My last cell on the first detail view is an imagepicker which I would like to be clickable to a new view to zoom in and out of the image unless the table is in edit mode which allows me to change image again.
From what I have found, there doesn't seem to be anything that does this.
Kind regards
Ian

TableView help
Started by
Ian Lawson-Smith
, Sep 02 2011 01:18 PM
7 replies to this topic
#1
Posted 02 September 2011 - 01:18 PM
- hoinivoniough likes this
#2
Posted 02 September 2011 - 01:55 PM
Hi Ian and welcome to our forums! 
I am assuming you're using an SCArrayOfObjectsSection, right? By definition, an SCArrayOfObjectsSection will only display the cells corresponding to the objects that exist in it's 'items' array. To add an additional SCImagePickerCell to your table view, you should do that in a new additional section.
Please tell me if you need any additional help.

I am assuming you're using an SCArrayOfObjectsSection, right? By definition, an SCArrayOfObjectsSection will only display the cells corresponding to the objects that exist in it's 'items' array. To add an additional SCImagePickerCell to your table view, you should do that in a new additional section.
Please tell me if you need any additional help.
#3
Posted 02 September 2011 - 02:00 PM
Hi,
Thanks for the very quick reply.
I have a fabric class as follows.
I access this like the following.
I would like the last cell (Image cell) to take me to a different view if in edit mode or use the SCImagePicker when in edit mode.
Kind regards
James
Thanks for the very quick reply.
I have a fabric class as follows.
@interface Fabric : NSManagedObject { @private } @property (nonatomic, retain) NSString * colour; @property (nonatomic, retain) NSString * name; @property (nonatomic, retain) NSString * notes; @property (nonatomic, retain) NSNumber * quantity; @property (nonatomic, retain) NSNumber * status; @property (nonatomic, retain) NSString * supplier; @property (nonatomic, retain) NSString * image; @end
I access this like the following.
tableViewModel = [[SCTableViewModel alloc] initWithTableView:[self tableView] withViewController:self]; [tableViewModel setDelegate:self]; // Make class def SCClassDefinition *fabricDef = [SCClassDefinition definitionWithEntityName:@"Fabric" withManagedObjectContext:[delegate managedObjectContext] withPropertyNames:[NSArray arrayWithObjects:@"name", @"quantity", @"supplier", @"colour", @"status", @"notes", @"image", nil]]; [fabricDef setRequireEditingModeToEditPropertyValues:YES]; // Customise the properties. SCPropertyDefinition *nameDef = [fabricDef propertyDefinitionWithName:@"name"]; [nameDef setRequired:YES]; [nameDef setAttributes:[SCTextFieldAttributes attributesWithPlaceholder:@"Name"]]; SCPropertyDefinition *qtyDef = [fabricDef propertyDefinitionWithName:@"quantity"]; [qtyDef setType:SCPropertyTypeNumericTextField]; SCPropertyDefinition *notesPropertyDef = [fabricDef propertyDefinitionWithName:@"notes"]; [notesPropertyDef setType:SCPropertyTypeTextView]; SCPropertyDefinition *statusDef = [fabricDef propertyDefinitionWithName:@"status"]; [statusDef setType:SCPropertyTypeSegmented]; [statusDef setAttributes:[SCSegmentedAttributes attributesWithSegmentTitlesArray:[NSArray arrayWithObjects:@"Got It", @"Need It", nil]]]; SCPropertyDefinition *imageDef = [fabricDef propertyDefinitionWithName:@"image"]; [imageDef setType:SCPropertyTypeImagePicker]; SCArrayOfObjectsSection *objectsSection = [SCArrayOfObjectsSection sectionWithHeaderTitle:@"" withEntityClassDefinition:fabricDef]; [objectsSection setAddButtonItem:[[self navigationItem] rightBarButtonItem]]; [objectsSection setAutoSelectNewItemCell:NO]; [tableViewModel addSection:objectsSection];
I would like the last cell (Image cell) to take me to a different view if in edit mode or use the SCImagePicker when in edit mode.
Kind regards
James
#4
Posted 02 September 2011 - 03:25 PM
Hi James,
I now get what you're after. To have SCImagePickerCell have your required custom behavior, you need to subclass it and override its 'didSelectCell' method. Please tell me if you need any help with that.
I now get what you're after. To have SCImagePickerCell have your required custom behavior, you need to subclass it and override its 'didSelectCell' method. Please tell me if you need any help with that.
#5
Posted 03 September 2011 - 10:02 AM
Hi Terekskr
That would be helpful thanks.
I am using Xcode 4.2 with ARC enabled so I don't need retains / releases.
I know how to subclass but I don't understand how I tell the PropertyDef to use the subclassed cell over the SCImagePickerCell.
Kind regards
James
That would be helpful thanks.
I am using Xcode 4.2 with ARC enabled so I don't need retains / releases.
I know how to subclass but I don't understand how I tell the PropertyDef to use the subclassed cell over the SCImagePickerCell.
Kind regards
James
#6
Posted 03 September 2011 - 10:15 AM
Hi James,
We'll be adding a detailed example of this in our next minor version release, due in less than 24 hours. The example will be added to our "Custom Cells App" sample application.
Please tell me if you need anything else.
We'll be adding a detailed example of this in our next minor version release, due in less than 24 hours. The example will be added to our "Custom Cells App" sample application.
Please tell me if you need anything else.
#7
Posted 04 September 2011 - 02:48 PM
Hi Terekskr,
I have found by looking at the source that what I want is already implemented. All I have to do is configure the cell and set it enabled.
Thanks for all the help!
Kind regards
James
I have found by looking at the source that what I want is already implemented. All I have to do is configure the cell and set it enabled.
Thanks for all the help!
Kind regards
James
#8
Posted 04 September 2011 - 05:39 PM
Great, thanks for updating me on this.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users