On Jul 1, 2009, at 9:26 AM, David Blanton wrote:

I have searched and find nothing that helps with the subject line warning.

        in .h file

        NSMutableArray *m_sources;

        in .mm file

        if(m_sources != nil) [m_sources release];

Unnecessary, sending messages to nil does nothing so checking for nil is just a waste of time here.

m_sources = [volumes stringsByAppendingPaths:[defaultManager directoryContentsAtPath:volumes]];

You declared m_sources as an NSMutableArray, but your assigning it an NSArray here. Since an NSMutableArray is a subclass of NSArray and not the other way around, that is why you are getting the error.

        [m_source retain];

note if I do not release / retain m_sources the program crashes with exec bad access


Correct. If you don't understand why, I recommend reviewing the Cocoa Memory Management Guidelines at <http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html >
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to