function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
tschlosstschloss 

[zkSforce] QueryResult autorelease? / NSTableView protocol

Hi,

 

while learning Objective-C and the zkSforce library in parallel I came across two questions:

 

1.) The query result is sent an autorelease before returned to the caller.

This may be ok and my caller has to deal with it, but I had a problem when I tried to run a query in one method and work on it in another method (both using a common instance variable where I saved the zkQueryResult object pointer. The object was deallocated somewhere in the middle of my program. After sending an retain to it once, it persisted, but I am not sure if this is the intended way.

 

2.) NSTableView protocol implemented in the category to zkQueryResult

Both the return value of the row-count method and the row index parameter of the value query method are documented as NSInteger but the library uses int. No warnings, no problems - but I just wanted to mention it not knowing if it can produce trouble in a certain situation.

 

Cheers

Thomas

SuperfellSuperfell

1.this is by design, and is the recommended practice from apple on memory management. (you should check out the apple docs on memory management policy if you haven't already)

 

2. it used to be int in older versions of osx (when szSforce was first written), it ought to be updated to NSInteger, but it shouldn't really matter.