• 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
Question about init methods....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about init methods....


  • Subject: Question about init methods....
  • From: "Juan P. Pertierra" <email@hidden>
  • Date: Sat, 10 Dec 2005 16:37:40 -0500

I am writing some cocoa code that is part of a rendering engine. I am outputting a large number of images, and I use the NSBitmapImageRep class for each image.

I already have all the data processed, and I'm just creating an ImageRep for each image which points to the frame in the bulk image data, use the ImageRep to save the image file, and then move to the next image.

The problem is that, the only way there seems to assign the image data pointer is in NSBitmapImageRep's init method. This means that I have to release and then allocate a new NSBitmapImageRep object on every image, just to change the pointer to the data, because all the other paramters such as image size are the same.

Is there anyway around this? I attempted calling the init method again without releasing and allocating, but that didn't work. It seems the deallocation and allocation will add some time to the process which will make it take longer.

It seems this question may apply to any class, as i've seen more than one in which only attributes are set using the init methods, but there are no other setters to change individual parameters.

Thanks,
Juan
_______________________________________________
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
  • Prev by Date: checkbox grouping with binding
  • Next by Date: system profiles
  • Previous by thread: Re: checkbox grouping with binding
  • Next by thread: system profiles
  • Index(es):
    • Date
    • Thread