문제

I'm currently trying to learn Cocoa/Objective-C to build Mac OS X softwares. I come from Delphi, and in Delphi a really really useful element is the TStringList. I'm looking for an equivalent in Objective-C... I need to be able to access an item (one line) in the virtual list.

For example, in Delphi I can call Label.Caption := MyStrList[5]; to display (as a String) an item in the list. I would like to do "the same" thing in Cocoa.

For info, I used TStringList in Delphi to manage the list of operations that my multi-threaded applications had to do.

Thanks in advance !

Beny

도움이 되었습니까?

해결책

Its NSArray (or NSMutableArray) with NSString objects in it. You can write something like

NSArray *array=[NSArray arrayWithObjects:@"string1",@"string2",@"string3",nil];
label.text=[array objectAtIndex:1];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top