NSStringUtf8('test.waw'),True);// should it be test.wav instead of .waw?
mySound.play;
keep in mind that you HAVE to use the result of initXXX method as the actual object. This is ObjC allocation/initialization rule.
Keep in mind that calling "alloc" requires you to use either "autorelease" or an explicit "release" at some point. "autorelease" will deallocate the object as soon as it not need by Cocoa. (generally that means at the end of the current system event handling) "release" will "deallocate" the object when you call it.
Yet, since all Cocoa object are Cocoa-reference counted, the term "deallocation" should not be taken literally. It's "deallocated" only from your own code perspective.
Title: Re: Set a variable in cocoa
Post by: maxnd on May 01, 2020, 08:55:09 pm
OK, now it works fine. Thanks!
Title: Re: Set a variable in cocoa
Post by: skalogryz on May 01, 2020, 08:55:58 pm
I've edited my previous post and added information about deallocation.
Title: Re: Set a variable in cocoa
Post by: maxnd on May 01, 2020, 09:01:39 pm