collections - IOS IBOutletCollection UITextView -
i want implement cardslib text inside (title, description, footer).
i thought use iboutletcollection textview, open other solutions.
i've linked xib file collection interface.
in class implementation :
@synthesize mytextviewcollection; - (void)viewdidload { mytextviewcollection = [nsmutablearray arraywithobjects:@"one", @"two", @"three", nil]; (uitextview *myview in mytextviewcollection) { nslog(@"%@", myview); myview.text = @"any text"; } } myview contain 3 strings : "one", "two", "three".
output error :
-[__nscfconstantstring settext:]: unrecognized selector sent instance 0x461b8 i don't understand why error ...
thanks !
what iboutlets text views? want this:
@property (nonatomic, weak) iboutlet uitextview* textviewone; @property (nonatomic, weak) iboutlet uitextview* textviewtwo; @property (nonatomic, weak) iboutlet uitextview* textviewthree; then:
for (uitextview *textview in @[ self.textviewone, self.textviewtwo, self.textviewthree ]) { textview.text = @"any text"; } what have done add bunch of nsstring literals array, you're trying send settext: selector nsstring, not selector nsstring responds to.
Comments
Post a Comment