Re: Storing bundle loaded main class instances in NSArray
Re: Storing bundle loaded main class instances in NSArray
- Subject: Re: Storing bundle loaded main class instances in NSArray
- From: Alexander Spohr <email@hidden>
- Date: Thu, 9 Apr 2009 16:47:07 +0200
Sorry I did not follow this thread as I thought it was a clear malloc/
free error.
size_t fread(void * restrict ptr, size_t size, size_t nmemb,
FILE * restrict stream);
Where is your ptr coming from?
If you comment out fread but rthe just crash somewhere else I’d bet
your ptr or stream is garbage.
Please post the allocation/deallocation code around the fread.
atze
Am 09.04.2009 um 15:57 schrieb Daniel Luis dos Santos:
Summarizing the behaviour I see here
If I add an object (which is the principal class of a bundle) to an
NSMutableArray, later in the program I get the exception that the
NSFileManager default manager object does not respond to a known
message selector.
I further narrowed it down to a fread call (standard libc) that I do
just before the exception is thrown. If I comment the fread the
error appears at another point in the code when I am initializing a
NSDictionary with dictionaryWithDictionary. That other error shows
itself in the gdb log as a pointer modified after being freed.
Since this error is a bit difficult to track and explain through
emails, I appreciate all your help, and think I will try to debug
some more (change the code to some other way of doing it).
Thanks anyway
On Apr 9, 2009, at 1:38 AM, Graham Cox wrote:
On 09/04/2009, at 2:13 AM, Daniel Luis dos Santos wrote:
I expect a file manager and it tells me that it does not respond
to fileExistsAtPath
No you don't.
According to your original post, you are complaining that calling -
addObject on _instances throws this error. So does _instances point
to NSFileManager or an array, as the code implies?
You're confused, so the rest of us have no chance.
Regarding your comments about autorelease pools, sounds like you're
relying on some assumed behaviour that is not stated anywhere in
any documentation. Don't do that, you're just creating problems
that don't need to be there. What about the autorelease pools
created around the main event loop for example?
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden