NSObject Category Issue on iOS

2011-03-29 Thread Nik Heger
I am new to Objective-C so please forgive me if this is obvious. I come from Ruby, where extending built in classes is straight forward - you do it, and it works. I expected the same in Obj-C but got a confusing result: It works sometimes, but not others. Here is what I did: 1 - Created a Catego

A Data Object in Cocoa

2009-01-09 Thread nik heger
I am trying to define a pure data object in Cocoa. This object doesn't do anything, it should just act as a container for three strings. This is generally a good design pattern, at least in Java. In Cocoa, I am running into a lot of resistance. The constructor is rather complicated. And t

Re: A Data Object in Cocoa

2009-01-10 Thread nik heger
Thanks for all your responses. I am indeed using synthesized properties which hopefully will free me from having to do play around with retain/release. How anyone can get any work done without an automatic GC is unclear to me - you guys are hard core ;) Prior to embarking on Cocoa develo

NSData release seg fault. Whoops.

2009-01-19 Thread nik heger
I figured out how to make this code "work" but I still don't know what the problem was. Can someone enlighten me? - (void)testSegFault { int size = 8; uint8_t *bytes = malloc( size * sizeof(uint8_t) ); NSData *data = [NSData dataWithBytesNoCopy:by