• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Can't bind my array to that scrollview
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can't bind my array to that scrollview


  • Subject: Can't bind my array to that scrollview
  • From: email@hidden
  • Date: Wed, 29 Jun 2005 13:14:55 +0200

Hi,

I am just beginning in Cocoa and I am trying to learn bindings.
I made a very simple Class named "Query" that has two instance variables : input
(a NSNumber) and output (a NSArray). Well, here the code from "query.m" :

@implementation Query
- (id) init {
	self = [super init];
	if (self != nil) {
		[self setInput:[NSNumber numberWithInt:5]];
		[self setOutput:[NSArray arrayWithObjects:@"one",@"two",@"three",nil]];
	}
	return self;
}

- (void) setInput : (NSNumber *) theInput {
	input = theInput;
}

- (void) setOutput : (NSArray *) theOutput {
	output = theOutput;
}

- (NSNumber *) input {
	return input;
}

- (NSArray *) output {
	return output;
}
@end

I bound input to a text field, it worked ok.
I bound output to a NSScrollView and, instead of displaying "one", "two",
"three" on a different line, it displays the following string :
"(one,two,three)" on the first line of my scroll view.

Why is that ?

Thanks for your help,
Martin.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Can't bind my array to that scrollview
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Re: To Automate Web Application
  • Next by Date: Re: mounting volumes programmatically
  • Previous by thread: Drag and Drop + Resizable View
  • Next by thread: Re: Can't bind my array to that scrollview
  • Index(es):
    • Date
    • Thread