• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Crash after [NSData dataWithData:(NSMutableData *)]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash after [NSData dataWithData:(NSMutableData *)]


  • Subject: Re: Crash after [NSData dataWithData:(NSMutableData *)]
  • From: email@hidden
  • Date: Tue, 26 Jul 2005 16:07:57 -0700

On Jul 26, 2005, at 6:48 AM, j o a r wrote:
This is Cocoa memory management 101...

A precise description of my Cocoa experience! :-)


On Jul 26, 2005, at 6:52 AM, Nicko van Someren wrote:
You did not get the sourceData object with new, alloc or copy, therefore you do not "own" the object and you should not release it since it is an autorelease object.

Ah, that's the problem -- I was under the incorrect impression that the <thing>With<Condition> methods behaved like [[Thing alloc] initWith<Condition>].


So, if I had done [[NSData alloc] initWithData:...] instead of [NSData dataWithData:...], the result it would not be autoreleased and would have a retain count of 1. Did I get that right?

Thanks again.
_______________________________________________
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


  • Follow-Ups:
    • Re: Crash after [NSData dataWithData:(NSMutableData *)]
      • From: Charilaos Skiadas <email@hidden>
References: 
 >Crash after [NSData dataWithData:(NSMutableData *)] (From: email@hidden)
 >Re: Crash after [NSData dataWithData:(NSMutableData *)] (From: Nicko van Someren <email@hidden>)

  • Prev by Date: Re: Developing for Tiger and Panther;
  • Next by Date: [ANN] bindlist.py: A simple tool for listing all the bindings in a nib
  • Previous by thread: Re: Crash after [NSData dataWithData:(NSMutableData *)]
  • Next by thread: Re: Crash after [NSData dataWithData:(NSMutableData *)]
  • Index(es):
    • Date
    • Thread