Am Di,12.08.2008 um 21:36 schrieb Shawn Erickson:
On Tue, Aug 12, 2008 at 2:12 AM, Negm-Awad Amin [EMAIL PROTECTED]
wrote:
BTW: You can do the same inside a getter to get rid of thread
problems.
Nope it does nothing to solve threading issues ([[blah retain]
autorelease] isn't an atomic
Peter N Lewis wrote:
I'm no Cocoa expert, but I think you're wrong on this, you've missed
out a crucial line:
At 3:12 PM -0400 11/8/08, Sean DeNigris wrote:
// Get uid to return
NSString* todoUid = [newTodo uid];
// Clean up
[newTodo release];
newTodo
no as far as possible, you shouldn't retain an accessor, you are not
the owner of this accessor
the accessor is owned by an the his object, you are the owner
of an instance of one object when you create it
for an example
myobject {
private dict;
}
string title();
...
string title() {
Am Di,12.08.2008 um 04:51 schrieb Peter N Lewis:
At 4:48 PM -0400 11/8/08, Kyle Sluder wrote:
On Mon, Aug 11, 2008 at 3:12 PM, Sean DeNigris
[EMAIL PROTECTED] wrote:
Hi, how do I handle memory management for todoUid below? Do I
have to
retain or autorelease it?
[...snip...]
//
Am Di,12.08.2008 um 14:37 schrieb Sean DeNigris:
Hi, how do I handle memory management for todoUid below? Do I
have to
retain or autorelease it?
[...snip...]
// Get uid to return
NSString* todoUid = [newTodo uid];
[...snip...]
return todoUid;
}
you could do:
NSString*
On Mon, Aug 11, 2008 at 10:51 PM, Peter N Lewis [EMAIL PROTECTED] wrote:
[newTodo release] is not [newTodo autorelease]. So it may immediately call
dealloc and dealloc the uid returned by by [newTodo uid].
You're right about this; I did miss the -release.
--Kyle Sluder
On Aug 11, 2008, at 10:51 PM, Peter N Lewis wrote:
I'm no Cocoa expert, but I think you're wrong on this, you've missed
out a crucial line:
At 3:12 PM -0400 11/8/08, Sean DeNigris wrote:
// Get uid to return
NSString* todoUid = [newTodo uid];
// Clean up
On Tue, Aug 12, 2008 at 2:12 AM, Negm-Awad Amin [EMAIL PROTECTED] wrote:
BTW: You can do the same inside a getter to get rid of thread problems.
Nope it does nothing to solve threading issues ([[blah retain]
autorelease] isn't an atomic operation) you need to protect it with an
critical section
On Aug 12, 2008, at 11:51 AM, Brian Stern wrote:
On Aug 11, 2008, at 10:51 PM, Peter N Lewis wrote:
[newTodo release] is not [newTodo autorelease]. So it may
immediately call dealloc and dealloc the uid returned by by
[newTodo uid]. To avoid this, you could do:
Not really. This line:
Clearly, there is a lot more going on in the code in this question
than in typical Cocoa code.
That said, if you want to avoid bugs, it would seem that the
following is good advice:
* Always use autorelease.
* Use an Auto Release Pool if necessary (in loops, or with large
memory
Hi, how do I handle memory management for todoUid below? Do I have to
retain or autorelease it?
I'm using Scripting Bridge to communicate with iCal. Also, this is a
sub-routine and todoUid will only be used in the method that calls it.
- (NSString*) saveToiCalTodo: (NSString*) theSummary
On Mon, Aug 11, 2008 at 3:12 PM, Sean DeNigris [EMAIL PROTECTED] wrote:
Hi, how do I handle memory management for todoUid below? Do I have to
retain or autorelease it?
[...snip...]
// Get uid to return
NSString* todoUid = [newTodo uid];
[...snip...]
return todoUid;
On Aug 11, 2008, at 1:12 PM, Sean DeNigris wrote:
Hi, how do I handle memory management for todoUid below? Do I have
to retain or autorelease it?
I'm using Scripting Bridge to communicate with iCal. Also, this is
a sub-routine and todoUid will only be used in the method that calls
it.
On Mon, Aug 11, 2008 at 3:12 PM, Sean DeNigris
[EMAIL PROTECTED] wrote:
Hi, how do I handle memory management for todoUid below? Do I have
to
retain or autorelease it?
[...snip...]
// Get uid to return
NSString* todoUid = [newTodo uid];
[...snip...]
[newTodo release];
At 4:48 PM -0400 11/8/08, Kyle Sluder wrote:
On Mon, Aug 11, 2008 at 3:12 PM, Sean DeNigris [EMAIL PROTECTED] wrote:
Hi, how do I handle memory management for todoUid below? Do I have to
retain or autorelease it?
[...snip...]
// Get uid to return
NSString* todoUid =
15 matches
Mail list logo