Change the text of a NSTextView programmatically
The right method is “setString” [textView setString:@”the string”];
The right method is “setString” [textView setString:@”the string”];
I have worked with Cocoa / Obj-C on and off over the years. As of 2010 I find it quite limiting compared to WPF / NET Framework. I will list some of the differences I’ve found, and you can judge for yourself. Markup language When I design in WPF I get markup that is very … Read more
Make your button type as NSMomentaryChangeButton. [myBtn setButtonType:NSMomentaryChangeButton]; If you use NSMomentaryPushInButton then you may get gray rectangle over the button when click.
Here is some code to programmatically create a table view with a scroll bar, and multiple columns. // create a table view and a scroll view NSScrollView * tableContainer = [[NSScrollView alloc] initWithFrame:NSMakeRect(10, 10, 380, 200)]; NSTableView * tableView = [[NSTableView alloc] initWithFrame:NSMakeRect(0, 0, 364, 200)]; // create columns for our table NSTableColumn * column1 … Read more
A C string is just like in C. char myCString[] = “test”; An NSString uses the @ character: NSString *myNSString = @”test”; If you need to manage the NSString’s memory: NSString *myNSString = [NSString stringWithFormat:@”test”]; NSString *myRetainedNSString = [[NSString alloc] initWithFormat:@”test”]; Or if you need an editable string: NSMutableString *myMutableString = [NSMutableString stringWithFormat:@”test”]; You can … Read more
At least on MacOSX 10.5.x you might use the command line tool “uuidgen” to get your string e.g. $ uuidgen 054209C4-3873-4679-8104-3C18AE780512 there’s also an option -hdr with this comand that conveniently generates it in header style See man-page for further infos.
I am currently looking into the same questions. For me the possibility of adding Windows clients later makes the situation more complicated; in your case the answer seems to be simpler. About the options you have considered: Control files: While it is possible to communicate via control files, you have to keep in mind that … Read more
A bundle is a structure used for packaging software on Mac OS X. Applications, frameworks and plug-ins are all different kinds of bundles. Bundles may contain executable code, resources, header files and other stuff (including other bundles) if you so wish. Bundles are implemented as directory trees with a defined structure. Applications, frameworks and plug-ins … Read more