Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
April 22, 2018, 09:22:03 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register Chat  
Pages: [1]   Go Down
  Print  
Author Topic: Copying the NSArray  (Read 2611 times)
jonthornham
Full Member
***
Posts: 169



WWW Email
« on: October 21, 2009, 08:24:09 PM »

In the webcast where it cuts out for a minute it appears that the copyWithZone method knows how to copy Arrays?

Previously it created the new Fraction object. When the webcast comes back it creates a new Array with the Fraction objects included.

How does the the copy of the NSArray copy the array without being affected by the copyWithZone method that include creating a new Fraction? If we over ride the dealloc method with an NSLog call all release methods end up printing the NSLog message.  Does the copy of the NSArray method skip this step or am I missing something?

I hope this makes sense.

Thanks,

Jon
Logged

Jon Thornham
jonthornham
Full Member
***
Posts: 169



WWW Email
« Reply #1 on: October 21, 2009, 08:27:42 PM »

Oh man. NSArray does not see the same copyWithZone method that the Fraction objects do. They are not part of the Fraction class! How did I miss that?

Thanks,

Jon
Logged

Jon Thornham
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents ゥ 2009 classroomM.com. All rights reserved.