This is really an Objective-C question, but the iPhone is the first platform that forced me to actually use my rusty Objective-C. I am very familiar of C-based CoreFoundation programming.
In Apple's Custom Table View example (the most advanced of the 5 in the download) there is some code like:
So to me, this looks similar to:
Is there an implicit retain on assignment? I see the pattern used a lot, so I assume that is the case. So in my code I could:
What about if I call a C function that returns a CFStringRef?
Is that correct?
In Apple's Custom Table View example (the most advanced of the 5 in the download) there is some code like:
Code:
NSMutableArray *regions = [[NSMutableArray alloc] init];
... code that fills in regions ...
self.displayList = regions;
[regions release];
So to me, this looks similar to:
Code:
x= CFCreateMutableArray(...);
this->x= x;
CFRelease(x);
Is there an implicit retain on assignment? I see the pattern used a lot, so I assume that is the case. So in my code I could:
Code:
group= [[NSMutableArray alloc] init];
[displayList addObject:group];
... fill in data in group array ...
[group release]
What about if I call a C function that returns a CFStringRef?
Code:
NSString *results= CFStringCreate...(...);
... handle results ...
[results release];
Is that correct?