Welcome, Guest
Username Password: Remember me

SCPropertyDefinition with >1 properties
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: SCPropertyDefinition with >1 properties

SCPropertyDefinition with >1 properties 1 year, 2 months ago #1

Hello,

how is it possible to show more than one property per cell?

For example i have an address and want to edit the
zip code, location, street in one cell over SCPropertyDefinition.
  • gemuese
  • OFFLINE
  • Senior Boarder
  • Posts: 52
  • Karma: 2

Re: SCPropertyDefinition with >1 properties 1 year, 2 months ago #2

Hi Julian,

This is easily possible starting STV 2.0. Please have a look at the "Custom Cells App" sample application bundled with the package.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: SCPropertyDefinition with >1 properties 1 year, 2 months ago #3

hi tarek!

I try to do it directly without having a list of objects, but it doesn't work. I want to display firstName, lastName, street etc. in custom cells like the Contact-App on iPad.

I used not the SCArrayOfObjectsSection class, because i don't know why now section items are neccessary?!

Here my Code:
 
model = [[SCTableViewModel alloc] initWithTableView:self.tableView withViewController:self];
 
SCClassDefinition *contactDef = [SCClassDefinition definitionWithClass:[FACTS_ContactPerson class] withPropertyNames:[NSArray arrayWithObjects:@"firstName", nil]];
 
NSDictionary *contactDataBindings = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"firstName", @"lastName", nil]
forKeys:[NSArray arrayWithObjects:@"1", @"2", nil]];
 
//SCCustomPropertyDefinition *dataProperty = [SCCustomPropertyDefinition definitionWithName:@"test" withuiElement:[[TestCell alloc] init] withObjectBindings:contactDataBindings];
SCCustomPropertyDefinition *dataProperty = [SCCustomPropertyDefinition definitionWithName:@"test" withuiElementNibName:@"ContactDataCell" withObjectBindings:contactDataBindings];
 
 
[contactDef insertPropertyDefinition:dataProperty atIndex:0];
 
SCObjectSection *objectSection = [SCObjectSection sectionWithHeaderTitle:@"test" withBoundObject:contactPerson withClassDefinition:contactDef];
[model addSection:objectSection];
 


Thanks for your help!!!
  • gemuese
  • OFFLINE
  • Senior Boarder
  • Posts: 52
  • Karma: 2

Re: SCPropertyDefinition with >1 properties 1 year, 2 months ago #4

Hi Julian,

If I understand you correctly, this is exactly what we did in the "Custom Cells App" using a custom cell that has several text fields bound to an object. If you're still stuck, please send me your project (to our support email) so that I could get a better understanding of what you're trying to do.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: SCPropertyDefinition with >1 properties 1 year, 2 months ago #5

Hi Tarek,

i write a test application for you, but in that it works how it has to work!

In my productive project (not allowed to send you that code) i got the following error.
I call this controller as a modal view over a splitview... but i it will be quite suspect,
if thats the reason! Any idea? :/
I send the sample code via email, also...

 
2011-03-08 16:36:26.024 FACTS_iOS[6391:207] -[SCCustomPropertyDefinition ownerClassDefinition]: unrecognized selector sent to instance 0x6b7eb20
2011-03-08 16:36:26.027 FACTS_iOS[6391:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SCCustomPropertyDefinition ownerClassDefinition]: unrecognized selector sent to instance 0x6b7eb20'
*** Call stack at first throw:
(
0 CoreFoundation 0x015fcbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x01d035c2 objc_exception_throw + 47
2 CoreFoundation 0x015fe6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x0156e366 ___forwarding___ + 966
4 CoreFoundation 0x0156df22 _CF_forwarding_prep_0 + 50
5 FACTS_iOS 0x001dfbcf -[SCObjectSection getCellForPropertyWithDefinition:withBoundObject:] + 3670
6 FACTS_iOS 0x001dec8b -[SCObjectSection initWithHeaderTitle:withBoundObject:withClassDefinition:] + 337
7 FACTS_iOS 0x001deade +[SCObjectSection sectionWithHeaderTitle:withBoundObject:withClassDefinition:] + 101
8 FACTS_iOS 0x001b4ea9 -[EditContactPersonViewController viewDidLoad] + 710
9 UIKit 0x00b6165e -[UIViewController view] + 179
10 UIKit 0x00b5fdca -[UIViewController nextResponder] + 34
11 UIKit 0x00b8066a -[UIResponder _containsResponder:] + 41
12 UIKit 0x00b6af2a -[UINavigationController defaultFirstResponder] + 80
13 UIKit 0x00b7f80b -[UIResponder(Internal) _deepestDefaultFirstResponder] + 42
14 UIKit 0x00b7f5ca -[UIResponder(Internal) _promoteDeepestDefaultFirstResponder] + 42
15 UIKit 0x00b3f9be -[UITransitionView _didStartTransition] + 94
16 UIKit 0x00b405e0 -[UITransitionView transition:fromView:toView:] + 615
17 UIKit 0x00d5be8e -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 6499
18 UIKit 0x00b65982 -[UIViewController presentModalViewController:withTransition:] + 3151
19 UIKit 0x00b5e269 -[UIViewController _tryRecursivelyPresentModalViewController:withTransition:] + 134
20 UIKit 0x00b5e22d -[UIViewController _tryRecursivelyPresentModalViewController:withTransition:] + 74
21 UIKit 0x00b65085 -[UIViewController presentModalViewController:withTransition:] + 850
22 FACTS_iOS 0x00022ad6 -[B2DepartmentTreeViewController contactPersonCell:DidSelectOption:] + 439
23 FACTS_iOS 0x001b1c2b -[ContactPersonTableViewCell editButtonClicked] + 134
24 UIKit 0x00ab3a6e -[UIApplication sendAction:to:from:forEvent:] + 119
25 UIKit 0x00b421b5 -[UIControl sendAction:to:forEvent:] + 67
26 UIKit 0x00b44647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
27 UIKit 0x00b431f4 -[UIControl touchesEnded:withEvent:] + 458
28 UIKit 0x00d3e987 _UIGestureRecognizerSortAndSendDelayedTouches + 3609
29 UIKit 0x00d3f0fc _UIGestureRecognizerUpdateObserver + 927
30 CoreFoundation 0x015ddfbb __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27
31 CoreFoundation 0x015730e7 __CFRunLoopDoObservers + 295
32 CoreFoundation 0x0153bbd7 __CFRunLoopRun + 1575
33 CoreFoundation 0x0153b240 CFRunLoopRunSpecific + 208
34 CoreFoundation 0x0153b161 CFRunLoopRunInMode + 97
35 GraphicsServices 0x02232268 GSEventRunModal + 217
36 GraphicsServices 0x0223232d GSEventRun + 115
37 UIKit 0x00ac242e UIApplicationMain + 1160
38 FACTS_iOS 0x00009d1c main + 102
39 FACTS_iOS 0x00009cad start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
"
(gdb)
  • gemuese
  • OFFLINE
  • Senior Boarder
  • Posts: 52
  • Karma: 2

Re: SCPropertyDefinition with >1 properties 1 year, 2 months ago #6

Hi Julian,

Did you try doing a clean build?
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72
  • Page:
  • 1
  • 2
Time to create page: 2.25 seconds