Re: Problems with objects getting crossed
Re: Problems with objects getting crossed
- Subject: Re: Problems with objects getting crossed
- From: Mark Williams <email@hidden>
- Date: Wed, 5 Oct 2005 17:59:47 -0700
Okay well let me ask this question since I don't know how to explain
it better, and since I'd have to post the entirety of both classes.
In the maincontroller class I call the downloader this way:
-(void)downloadFile:(NSDictionary*)file
{
NSDictionary * server = [NSDictionary
dictionaryWithObjectsAndKeys:[serverInfo address],@"Server Address",
[serverInfo port],@"Port",nil];
Downloader * downloader = [[Downloader alloc]init];
BOOL result = [downloader downloadFile:file fromServer:server];
NSLog(@"%i",result)
downloader = NULL:
[downloader release];
}
in the downloader class the init routine is pretty standard:
-(id)init
{
if(self=[super init]){
if([NSBundle loadNibNamed:@"Downloader" owner:self]){
return self;
}
else{
NSLog(@"NIB load failed, bailing out.");
return NULL;
}
return NULL;
}
and the download routine inits the stream object thusly:
-(BOOL)downloadFile:(NSDictionary*)file fromServer:(NSDictionary*)server
{
StreamObj = streamObject = [[StreamObject alloc]
initWithServer:server delegate:self];
}
and the stream init is really simple:
-(id)initWithServer:(NSDictionary*)server delegate:(id)delegate
{
if(self=[super init]){
serverInfo = [[NSDictionary alloc]initWithDictionary:server];
streamDelegate = delegate;
return self;
}
return NULL;
}
So as you can see I'm not doing anything special here really. Does
this help with the issue at all or do you need more code? Let me know
what you need I'll give it up.
There is one thing though. The streamobject does use CFStream a lot.
would that cut down it's modularizsm? is that a word?
On Oct 5, 2005, at 3:53 PM, Pete Yandell wrote:
Mark,
On 06/10/2005, at 1:51 AM, Mark Williams wrote:
I thought the point of object oriented programing was to be able
to do this type of thing, so I know it has to be me, does any one
know what I might be missing?
I don't think anybody on here is really going to be able to help
you without a lot more information. Objects don't suddenly get
"crossed up" for no reason, so it's definitely something that
you're doing, but it's impossible to say what that might be from
the very high-level description you've given. Got some code you can
post?
As for the debugger only showing assembly, I don't know how you
could make XCode do that if you wanted it to! Is it just with this
project? If you create a new little test project and debug that,
does it work?
Cheers,
Pete Yandell
_______________________________________________
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