![](/img/trans.png)
[英]Call to function 'CFURLCreateStringByAddingPercentEscapes' returns a Core Foundation object with a +1 retain count
[英]Call to function 'CFUUIDCreate' returns a Core Foundation object with a +1 retain count
在項目中添加了共享工具包組,發現修復了許多編譯警告,但大多數仍未顯示。
這是來自OAMutableURLRequest.m類
- (void)_generateNonce
{
CFUUIDRef theUUID = CFUUIDCreate(NULL);
CFStringRef string = CFUUIDCreateString(NULL, theUUID);
NSMakeCollectable(theUUID);// **Reference count decremented on this line**
nonce = (NSString *)string; //**Incorrect decrement of the reference count of an object that is not owned at this point by the caller on this line**
}
不知道如何解決這個問題。
感謝幫助。
解決了。 實際上,在這種情況下,我並沒有分享要發布的內容,但是當我添加時
- (void)_generateNonce
{
CFUUIDRef theUUID = CFUUIDCreate(NULL);
CFStringRef string = CFUUIDCreateString(NULL, theUUID);
NSMakeCollectable(theUUID);
nonce = (NSString *)string;
//[string autorelease];
CFRelease (theUUID);
}
有效。 看來我負責釋放我在CFUUIDCreate中分配的theUUID。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.