Welcome, Guest
Username Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Custom Data

Custom Data 1 year, 9 months ago #1

I am trying to figure out how to insert custom data and I am not sure how the delegates would work.

Suppose I wanted to insert a photo and the current location into my entity in the data model. How do I get other elements in the section view to work with sensible cocoa and accomplish this?


My Concerns About This Task:

I will have a UIImageView attached to a PhotoPicker that get my image and saves it. How would I save the image name to my object model. If I use a sqlite query, where do I get the object id to edit from?

This is much more simple. How do I save the current location into my entity's lat and lon properties. Do the delegates pass a reference to our object? Which delegate would I use?

Thanks for your time again.
  • baberuth22
  • OFFLINE
  • Expert Boarder
  • Posts: 84
  • Karma: 2

Re: Custom Data 1 year, 9 months ago #2

1- Regarding the PhotoPicker, how do you implement this functionality? Did you inherit from SCTableViewCell and created something like SCPhotoPickerCell? If not, would you like us to develop such functionality?

2- Both SCObjectSection and SCObjectCell have a property called boundObject that provides a reference to your managed object. If you are using an SCArrayOfObjectsSection, then you can use the following SCTableViewModelDelegate to do what you want:

 
- (void)tableViewModel:(SCTableViewModel *)tableViewModel detailViewWillAppearForSectionAtIndex:(NSUInteger)index withDetailTableViewModel:(SCTableViewModel *)detailTableViewModel
{
SCObjectSection *detailSection = [detailTableViewModel sectionAtIndex:0];
 
NSManageObject *myManagedObject = detailSection.boundObject;
 
// Set your managed object's attributes normally here
...
}
 
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: Custom Data 1 year, 9 months ago #3

1. Again regarding the PhotoPicker, is it possible for the detail tableview to be a view with both a tableview and an imageview? I would rather not extend SCPhotoPickerCell, but if it has to be done so be it.

2. I see that I can populate a cell with properties from my managed objects by using a bound object, but what about when adding a new object to my managed objects. How would I insert lat and lon float values into a new object?

Thanks
  • baberuth22
  • OFFLINE
  • Expert Boarder
  • Posts: 84
  • Karma: 2

Re: Custom Data 1 year, 9 months ago #4

1- If you develop a custom detail view then it can be anything you want. Sensible TableView fully supports having your tableview with any other combination of UI controls. Having said that, if you feel you have here something that's really common to most other developers, we can develop that for you and have it as part of STV (if you'd like, you can send me more details & images to my email address).

2- You're right Martin, it's a really good idea to create new delegates that get called when a new item is created. We'll create those and send you a beta within the next 24 hours. Thanks a lot
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: Custom Data 1 year, 9 months ago #5

Thanks. I'd love to see an ImagePicker cell.

Are there delegates for when an item is edited as well?

Bryan
  • baberuth22
  • OFFLINE
  • Expert Boarder
  • Posts: 84
  • Karma: 2

Re: Custom Data 1 year, 9 months ago #6

Yes, we're also going to create delegates for when the item is edited.

Would you please email me in more details how exactly does the image picker cell you have in mind looks like? What exactly are you looking for in the detail view of that cell? Thank you.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72
  • Page:
  • 1
  • 2
Time to create page: 1.67 seconds