A few programming problems...
- From: haydnjolly@xxxxxxxxxxx
- Date: 2 May 2006 00:53:07 -0700
I'm quite new to Cocoa/Objective-C and the mac platform, and I have a
few problems. I've tried to fix things, I've searched etc. Or maybe
I'm just dumb. Anyway.
1. I have a form containing an NSOutlineView, and a timer which
updates it every 5 seconds, as it gets new data. It has four main
nodes in it. It updates correctly, but whenever it updates, it
collapses all the nodes that are expanded. I want them to stay open
but I can't find a way of doing it? I update it by updating my data
source and then calling the [tableView reloadData] method. Any ideas?
2. I think I've just made a stupid error/don't know what i'm doing
with this one. I've made a dock menu in my NSApplication delegate with
the - (NSMenu *)applicationDockMenu:(NSApplication *)sender method, and
it shows up fine. But I try to update it later by doing (the menu item
starts off disabled when I create the menu):
NSMenuItem *ms = [dockMenu itemWithTitle:@"My Status"];
int msi = [dockMenu indexOfItemWithTitle:@"My Status"];
NSLog(@"%@", ms);
NSLog(@"%d", msi);
[ms setEnabled:YES];
[dockMenu removeItemAtIndex:msi];
[dockMenu insertItem:ms atIndex:msi];
[dockMenu update];
but it doesn't update. Nothing happens. Any random dumb things I
could've done? It retrieves the menu item alright, just doesn't
update.
3. All of my windows open and close correctly with my window
controllers, except for one. It doesn't open when I call
[NSWindowController showWindow:self].
If I have the "open at launch time" (or whatever it is) selected in the
nib file, it opens, but I when I call the close method from the window
controller it doesn't close it, either.
When it is opened the first time it acts as though the window is
displayed, it calls the - (void)windowDidLoad method and starts
running, but the window doesn't show up.
It runs the same as all my other nibs, but for some reason just doesn't
display.
These are probably all just stupid errors which I've messed up from not
knowing what I'm doing well enough, but I don't know how to fix them,
any help would be appreciated because I don't have a clue.
.
- Follow-Ups:
- Re: A few programming problems...
- From: Patrick Machielse
- Re: A few programming problems...
- Prev by Date: Re: newbie with xcode - Am *VERY* disappointed...
- Next by Date: Re: A few programming problems...
- Previous by thread: Re: newbie with xcode - Am *VERY* disappointed...
- Next by thread: Re: A few programming problems...
- Index(es):
Relevant Pages
|