Re: Objective-C 2.0 @property(readonly) memory leak question

2009-02-03 Thread Adam Venturella
rote: > On Feb 3, 2009, at 7:39 AM, Adam Venturella wrote: >> >> return [collection copy]; > > http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/copy > > _

Objective-C 2.0 @property(readonly) memory leak question

2009-02-03 Thread Adam Venturella
I know that this is the wrong way to do it, but could someone explain why this causes a memory leak? The crux of it is, you set an ivar to be Mutable, and you set the property to return an immutable object. You override the default accessor method to return a copy of the mutable ivar. @interface

Re: Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare

2009-01-27 Thread Adam Venturella
Will thanks for the heads up, for my purposes this time around, the input stream will be coming in off the file system, but I did not want to load the whole thing into an NSData object. Graham, thanks for the byte-ordering nod as well. The file I am reading is assured to be in little-endian, and

Re: Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare

2009-01-26 Thread Adam Venturella
Thanks! I knew I was doing to many steps! On Mon, Jan 26, 2009 at 8:44 PM, Graham Cox wrote: > > On 27 Jan 2009, at 2:09 pm, Adam Venturella wrote: > >> NSData * d = [NSData dataWithBytes:buffer length:sizeof(buffer)]; >> uint * key = (uint *) malloc(sizeof(uint)

Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare

2009-01-26 Thread Adam Venturella
Here is what I am doing now.. I just feel like I have an extra step in converting the buffer into NSData...malloc...free uint sample = 0x04034b50; uint8_t buffer[sizeof(uint)]; [inputStream open]; [inputStream read: buffer maxLength:sizeof(buffer)]; NSData * d = [NSData dataWithBytes:buf

Re: Accessing interface elements (iPhone vs Mac)

2009-01-21 Thread Adam Venturella
, then a retain will be sent to the object anyway. I guess that is a nice fail-safe they put in place. On Wed, Jan 21, 2009 at 10:33 AM, Dave DeLong wrote: > On Jan 21, 2009, at 11:25 AM, Adam Venturella wrote: > >> I have seen this same behavior too, creating @properties for IBOutle

Re: Accessing interface elements (iPhone vs Mac)

2009-01-21 Thread Adam Venturella
ion_6.html#//apple_ref/doc/uid/1051i-CH4-SW30 On Wed, Jan 21, 2009 at 10:25 AM, Adam Venturella wrote: > I have seen this same behavior too, creating @properties for IBOutlets > on the iPhone. I have yet to run into a problem not > @property/@synthsizeing my Outlets on the iPhone, ev

Re: Accessing interface elements (iPhone vs Mac)

2009-01-21 Thread Adam Venturella
I have seen this same behavior too, creating @properties for IBOutlets on the iPhone. I have yet to run into a problem not @property/@synthsizeing my Outlets on the iPhone, everything seems to work just fine if you don't. So am I missing something? And am I correct in assuming you would then be

Re: CABasicAnimation : Can I run a CABasicAnimation and get it's updated values on it's progress?

2009-01-16 Thread Adam Venturella
, Kyle Sluder wrote: > On Fri, Jan 16, 2009 at 1:39 PM, Adam Venturella > wrote: >> Set the volume on an Audio Queue (make a fade out/fade in) > > Are you sure you want to tie automation of an audio queue property to > a timeline other than the one the audio queue follows? Sinc

Re: CABasicAnimation : Can I run a CABasicAnimation and get it's updated values on it's progress?

2009-01-16 Thread Adam Venturella
you trying to do? > > -Matt > > > On Jan 16, 2009, at 11:23 AM, Adam Venturella wrote: > >> So something like this would be better served with an NSTimer I take it? >> >> On Fri, Jan 16, 2009 at 9:54 AM, Matt Long >> wrote: >>> >

Re: CABasicAnimation : Can I run a CABasicAnimation and get it's updated values on it's progress?

2009-01-16 Thread Adam Venturella
AnimProps.html > > -Matt > > > On Jan 16, 2009, at 10:46 AM, Adam Venturella wrote: > >> Basically, I was thinking: Hey, why can't I use CABasicAnimation as a >> means to animate just a value, not tied to a layer or a view, eg: >> >> If my CABasicAnima

CABasicAnimation : Can I run a CABasicAnimation and get it's updated values on it's progress?

2009-01-16 Thread Adam Venturella
Basically, I was thinking: Hey, why can't I use CABasicAnimation as a means to animate just a value, not tied to a layer or a view, eg: If my CABasicAnimation duration is 1 second, and it's fromValue = 0 and it's toValue = 1 and say the interval was 100 milliseconds my value should increment by 0

Re: Enable Scripting Failing - Missing something? Based on SimpleScripingVerbs sample

2009-01-14 Thread Adam Venturella
wrote: > On Tue, 13 Jan 2009 13:17:11 -0800, "Adam Venturella" > said: > >>OSAScriptingDefinition >>MyScriptingDef.def > > (1) Why do you call it .def when the example so clearly calls it .sdef? > > (2) There are lots of tutorials (including mine onli

Re: Constructing class names dynamically

2009-01-14 Thread Adam Venturella
The output is the same, but there is also: #import objc_getClass([myString UTF8String]); I am going to guess that NSClassFromString(myString) is probably using objc_getClass(), maybe not. I didn't know NSClassFromString existed though, so I am switching to that instead of using the runtime.h fun

[SOLVED]: Enable Scripting Failing - Missing something? Based on SimpleScripingVerbs sample

2009-01-13 Thread Adam Venturella
I dunno what I was doing wrong, but I want back and made 2 new projects from scratch, following the steps I laid out, and they both woked. One was a Striaght up Cocoa app, he the other was a Core Data App. :: shrugs :: ___ Cocoa-dev mailing list (Cocoa

Enable Scripting Failing - Missing something? Based on SimpleScripingVerbs sample

2009-01-13 Thread Adam Venturella
I have been reading over the docs re: Implementing Scripting for the last couple of hours: http://developer.apple.com/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_implement/chapter_4_section_1.html#//apple_ref/doc/uid/2037-BBCJEEEC Looked Over this sample from the docs: Imp

Re: NSTextField input validation

2009-01-13 Thread Adam Venturella
AM, Keary Suska wrote: > > On Jan 12, 2009, at 5:22 PM, Adam Venturella wrote: > > So there we have it. Again this does do exactly what I want it to do, if >> the user tries to enter a letter or anything not a number, I get an >> NSBeep(); It works if the operation is a paste o

NSTextField input validation

2009-01-12 Thread Adam Venturella
When a user opts to edit the contents of a Text Cell in a Table View, in this case, I want to limit their input to numbers only. Looking at NSNumberFormattter, it would seem that it just formats, it does not restrict to it's format, which makes sense. Digging around for a bit, here is the method