Re: Why shouldn't I release?
Subject : Re: Why shouldn't I release?
From: Andrew Farmer <email@hidden >
Date: Fri, 30 Nov 2007 19:02:08 -0800
Delivered-to: email@hidden
Delivered-to: email@hidden
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; bh=k4GqpTGfu3RKUzXUD5XIlmrGthj6pisoYMVrR1nK4cc=; b=TBQDOBLJg2HUHjvWhQC8CSRA2ow5t/7gautF6RxyCE04MOTeLLOBVLIJn7UF2QTQJRYJQbGRgF0GvnAa0Xgv2TvfkHB3pQWs9wARjVpQs1De8M1lHhklfILHStEdsfaL0LaClhCGJf99JXPWVN+wIgqWlSNzDoi1PCl4GVUZGqU=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; b=tFBaudjm5kBeYOwtERz6YJnKo0bD2cNOtzvUOosPbzcogVBYj5RuKZNgQd71xI2N/6Ud5JMXh3LR9blpYDgXWynaep6KtqrO5E0yVo35bK6DO2iIcN9nIU6YY/J2MEAuDe4bVhDI3Ajl8U022sPJnRkWu1RIfrl0BQqNfcl3Q1U=
On 30 Nov 07, at 18:54, Ric L. wrote:
This doesn't make any sense to me. By my reckoning, stringWithFormat
should create a string with a retain count of 1. 'fLetterCountField
setStringValue' should assign the string to the field and the field
should retain the string. I should then be free to release it.
Read the Cocoa memory management rules [1]. "stringWithFormat" doesn't
fit the criteria of the fundamental rule, so the object it returns
isn't yours to release.
[1]: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.