Welcome, Guest
Username Password: Remember me

NSString instead of NSMutableSet for SelectionCell
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: NSString instead of NSMutableSet for SelectionCell

NSString instead of NSMutableSet for SelectionCell 1 year, 8 months ago #1

Looking at your intro tutorial the SCSelectionCell is bound the a NSMutableSet. I'd like to us a selection cell but bind the selection to a NSString in the bound object. My cell code current code:

NSArray *items = [NSArray arrayWithObjects:@"One",@"Two",nil];
NSArray *names = [NSArray arrayWithObjects:@"project",@"area",@"category", nil];

SCClassDefinition *secondClassDef = [SCClassDefinition definitionWithClass:[GECase class] withPropertyNames:names];

SCPropertyDefinition *projectPropertyDef = [secondClassDef propertyDefinitionWithName:@"project"];
projectPropertyDef.type = SCPropertyTypeSelection;
projectPropertyDef.attributes = [SCSelectionAttributes attributesWithItems:items allowMultipleSelection:NO allowNoSelection:NO];
projectPropertyDef.title = @"Project";


SCObjectSection *section = [SCObjectSection sectionWithHeaderTitle:nil withBoundObject:sourceCase withClassDefinition:secondClassDef];

[tableModel addSection:section];

The resulting cell doesn't display the original value of sourceCase.property. When you select the cell it allows you to select 'One' or 'Two' but then doesn't update the sourceCase.property property.

Any Ideas?
  • panamind
  • OFFLINE
  • Senior Boarder
  • Posts: 77
  • Karma: 4

Re: NSString instead of NSMutableSet for SelectionCell 1 year, 8 months ago #2

SCSelectionCell fully supports binding to NSString, and will do this automatically if its bound property is of type NSString. What is the type of your "project" property?
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: NSString instead of NSMutableSet for SelectionCell 1 year, 8 months ago #3

Love the prompt response.

sourceCase.property is an NSString. The class has several NSString properties that I want the user to set by choosing from separate arrays of strings.
  • panamind
  • OFFLINE
  • Senior Boarder
  • Posts: 77
  • Karma: 4

Re: NSString instead of NSMutableSet for SelectionCell 1 year, 8 months ago #4

Are you able to post your GECase interface code? I am just trying to replicate your problem, and making sure your project property declaration is the same as mine. Also if you like, please feel free to send us the project in at our support email.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: NSString instead of NSMutableSet for SelectionCell 1 year, 8 months ago #5

Getting code and a screen shot ready I discovered half the problem (selected values not updating sourceCase properties) solved itself. Now the original value of the selectioncell is not being set but I've discover an NSCFString issue in my code and suspect that may be the problem.

What I expect to be an NSString is passed as an NSCFString. For some reason [NSString stringWithUTF8String:(const char *)bytes]
still returns an NSCFString.

I'll have to resolve this problem first.

Thanks so far...
  • panamind
  • OFFLINE
  • Senior Boarder
  • Posts: 77
  • Karma: 4

Re: NSString instead of NSMutableSet for SelectionCell 1 year, 8 months ago #6

I sent code and a screen shot to your support email. If you need more let me know.
  • panamind
  • OFFLINE
  • Senior Boarder
  • Posts: 77
  • Karma: 4
  • Page:
  • 1
  • 2
Time to create page: 1.68 seconds