Hello,
Could someone give me some advice or a snippet of code that would show me the way of implementing the method in this listing . I would like to get some info about processes on a mac. I'm not so good with C, but am familiar with Objective C.
Thanks!
...
I have a menu where some of the menu items use bindings to get their title. These items are always enabled, and don't neither automatically enable/disable like they should NOR do they cause a call to validateUserInterfaceItem:. If you remove the binding on title, then that starts working again. The menu items have the target set to nil (...
I have a cocoa application that has a finder like feel it and is made up of five views. On the left there is a gallery which is a finder like interface to choose a given object. This view stretches across the whole height of the window. Then on the right I have a window for a 3D simulation view and then below it I have three editing v...
My iphone app crashes with the following error message:
2010-07-26 16:27:30.402 Nav[814:207]
* -[UITextField isNaturallyRTL]: unrecognized selector sent to instance
0x3947fe0 2010-07-26 16:27:30.403
Nav[814:207] Terminating app due
to uncaught exception
'NSInvalidArgumentException', reason:
'** -[UITextField isNaturallyR...
I've managed to implement the code on this listing to get a list of all the processes running and their IDs. What I need now is to extract how much time each process uses the CPU.
I've tried referring to the keys in the code, but when I try to print 'Ticks of CPU Time' I get a zero value for all of the processes. Plus, even if I did ge...
Hello,
I have a coding style question which probably should be asked of a senior mac programmer at work - but since I'm the only mac programmer, well, SO it is. I have a pop-up GUI for my software (3D models, data visualization) and the pop-up is Mainly a Tabbed control with a ton of stuff in each tab (sliders, radio buttons, checkboxe...
Hi everyone,
I'm using CFWriteStreamScheduleWithRunLoop and CFWriteStreamWrite to do asynchronous IO. Here's the question: it seems that only one CFWriteStreamWrite call is safe (free of blocking) per each kCFStreamEventCanAcceptBytes notification, because from the second call, we can't guarantee that the socket is ready to accept more ...
Hi,
This is a sibling question of Asynchronous IO with CFWriteStream. I'm using CFReadStreamScheduleWithRunLoop and CFReadSteamRead to do asynchronous IO. How can we safely retrieve all the date with blocking?
Let's say the actual size of a message was 1200 (but we don't know), and the size of my read buffer was 1024. A call to CFReadS...
Bear with me, this one is hard to explain. I hope some hero out there knows what’s going on here. Some history needed;
One of my cocoa objects, “Ball” represents a small graphic. It only makes sense within a view. In some of the Ball’s methods, it asks the view to redraw. Most importantly, it asks the view to redraw whenever the Ball’s ...
I send json_encoded data from my PHP server to iPhone app. Strings containing html entities, like '&' are escaped by json_encode and sent as &.
I am looking to do one of two things:
make json_encode not escape html entities. Doc says 'normal' mode shouldn't escape it but it doesn't work for me. Any ideas?
make the iPhone app un-es...
NSMenuItem -setTarget: Does it retain the target, or should one explicitly retain it?
I've seen conflicting docs on this. I know of retainArguments in NSInvocation, but I'm not sure this applies to NSMenuItem as it doesn't inherit from NSInvocation.
...
I used this guide: http://developer.apple.com/mac/library/qa/qa2004/qa1346.html to implement scaling in a special view. The scaled view is the document view of an NSScrollView. The problem is that when I call -scaleUnitSquareToSize, then call -setNeedsDisplay:YES (I also tried -setNeedsDisplay:YES on the scroll view), the view (not the...
I am working on an NSOutlineView that I populate by bindings to an NSTreeController. The NSTreeController contains objects of my own type. Everything is working as expected (getting the correct number of rows and disclosure indicators in the right places) expect that the titles for each row are coming up blank. I have overridden
-(NSSt...
Coming from a .NET background where you can easily generate an object model from an XML schema (through, for example xsd.exe) I wanted to know if there is a similar facility for generating Objective-C/NSObject objects.
Thanks!
...
I need to replace a method in an object with my own implementation. For example,
Person *p; // some object
NSMutableArray *array = [NSMutableArray array];
[array addObject: p];
How can I replace addObject with a method of my own?
In other words, is there a way to replace the implementation of addObject: of a SPECIFIC object with ano...
I have a button that adds a token to a NSTokenField. It adds the token always to the end of the field:
NSTokenField *currentField = [sender representedObject];
// Determine which token should be inserted into the field using the tag of the sender.
switch( [sender tag] )
{
case eFileNameToken_StartDate:
...
I have a currently working program that has IBOutlet and IBAction connections from the interface to File's Owner. I made a new class, and added that to the document window in Interface Builder. Then I moved everything from the File Owner class files to the new class files. I removed the old connections and reconnected everything to the n...
As my Cocoa app comes along, my NSWindowController is becoming huuuuuuuuuuge. My window has an NSTabView, and each tab therein has its own NSViewController (they all have submenus) and its own methods. So, my WindowController.m seems to stretch well beyond what it's supposed to because of tabs.
Sadly, examples of NSTabView are quite sim...
Hi, I got a problem with OpenGL ES on iPhone.
I'm working on a project, it draws something on the view, and then save the image. It also has a background image. I combined the image get from view and the background image.
I set the view's opaque property as NO, but the image get from the view still opaque. So I could not combine the tw...
How can I implement this validation in Cocoa?
My Situation is:
Model: An object names Person, with a name property. And an NSArray of Person objects,
View: NSTableView, it uses data-binding to bind with the Person object array. The NSTableView has in-place editing function enabled.
When user finish editing the name in NSTableView, I ...