1

プロジェクトに共有キット グループを追加したところ、非常に多くのコンパイル警告がほとんど修正されましたが、まだ表示されているものはほとんどありません。

これは 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**
}

これを修正する方法がわかりません。

手伝ってくれてありがとう。

4

1 に答える 1

0

解決しました。実際、私はこの場合に何をリリースするかを共有していませんでしたが、追加したとき

 - (void)_generateNonce
 {
CFUUIDRef theUUID = CFUUIDCreate(NULL);
CFStringRef string = CFUUIDCreateString(NULL, theUUID);
NSMakeCollectable(theUUID);
nonce = (NSString *)string;
//[string autorelease];
CFRelease (theUUID);
}

出来た。CFUUIDCreateで割り当てたtheUUIDを解放する責任があったようです。

于 2012-09-19T19:07:58.120 に答える