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: Objective-C 2.0 @property(readonly) memory leak question

2009-02-03 Thread Adam Venturella
wrote: 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 ___ Cocoa

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,

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

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 graham@bigpond.com 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)); [d

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: Accessing interface elements (iPhone vs Mac)

2009-01-21 Thread Adam Venturella
.html#//apple_ref/doc/uid/1051i-CH4-SW30 On Wed, Jan 21, 2009 at 10:25 AM, Adam Venturella aventure...@gmail.com 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

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 davedel...@me.com wrote: On Jan 21, 2009, at 11:25 AM, Adam Venturella aventure...@gmail.com wrote: I have seen this same behavior too, creating

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

2009-01-16 Thread Adam Venturella
/Articles/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 CABasicAnimation duration is 1 second, and it's fromValue = 0

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

2009-01-16 Thread Adam Venturella
for. What are 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 matt.l...@matthew-long.com wrote: Because you can't. These are the only properties

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 kyle.slu...@gmail.com wrote: On Fri, Jan 16, 2009 at 1:39 PM, Adam Venturella aventure...@gmail.com 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

Re: Constructing class names dynamically

2009-01-14 Thread Adam Venturella
The output is the same, but there is also: #import objc/runtime.h 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

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

2009-01-14 Thread Adam Venturella
...@tidbits.com wrote: On Tue, 13 Jan 2009 13:17:11 -0800, Adam Venturella aventure...@gmail.com said: keyOSAScriptingDefinition/key stringMyScriptingDef.def/string (1) Why do you call it .def when the example so clearly calls it .sdef? (2) There are lots of tutorials (including mine online

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:

[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

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