On Sun, Jun 1, 2008 at 1:15 PM, Gustavo Eulalio <[EMAIL PROTECTED]> wrote:

> Well, I'm novice to Cocoa/ObjC programming, so, I might be wrong. But
> I see you're setting a new frame on l2 every time fromTimer: is
> called, but you never release the old one. The following may solve it,
> if that's the problem.
>
> - (void) fromTimer: (NSTimer *) t
> {
>    [l2.frame release]
>     l2.frame = CGRectMake((double)random() / RAND_MAX*30, (double)random()
> /
>        RAND_MAX*30, (double)random() / RAND_MAX*40, (double)random() /
>        RAND_MAX*40);
>    l1.opacity = (double)random() / RAND_MAX;
> }
>
> Or are you using the garbage collector?
> By the way, shouldn't this be done via an accessor method? [l2
> setFrame:...]
>
>
frame is a CGRect readwrite property. It can be changed via l2.frame and
doesn't need any retain/release
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to