Re: shared instance and nstableview
Re: shared instance and nstableview
- Subject: Re: shared instance and nstableview
- From: Yorh <email@hidden>
- Date: Wed, 10 May 2006 14:16:25 +0200
I made some test:
All the shared istances are ok.
The strange thing is this one:
If I try to add a new record in the nstableview using a IBAction it
works:
-(IBAction)add:(id)sender{
NSLog (@"awake");
NSMutableDictionary * theDict = [[NSMutableDictionary alloc]init];
[theDict setValue:@"1.2.3.4" forKey:@"ip"];
[theDict setValue:@"456" forKey:@"port"];
[theDict setValue:@"test da button" forKey:@"channelName"];
[theDict setValue:@"2000" forKey:@"users"];
[[GAChannelList sharedInstance]addOneChannel:theDict];
[channelListView reloadData];
NSLog (@"shared dal datasource after action:%@",[GAChannelList
sharedInstance]);
}
But if I try to add it via this method the nstableview isn't refreshed:
-(void)addChannel:(NSMutableDictionary*)allTheChannels{
[[GAChannelList sharedInstance]addOneChannel:allTheChannels];
[channelListView reloadData];
NSLog (@"shared dal datasource loop:%@",[GAChannelList
sharedInstance]);
}
Of course the allTheChannels dictionary isn't empty and if I try to
print it in this loop I can read all the correct data :(
Really don't know why!
Thanks
Yorh
On 10/mag/06, at 09:33, Yorh wrote:
Hi Andy and thanks,
So what do you think have I to do?
I know that the double if is redundant, but when i call sharedList =
[self retain] i thought the sharedList variable was the same cause I
called the retain class method.
Anyway all the examples in Apple's docs and cocoadev.com use this
method and for me is the first time I use it.
thank you very much
Yorh
On 10/mag/06, at 04:40, Andy Lee wrote:
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden