1 頁 (共 1 頁)

益智問答

發表於 : 12/09/2002 11:50 pm
the real unknown
o-oh... looks what I have done... sorry la.

<BLOCKQUOTE><font size="1" face="XYZ">quote:</font><HR>
CFStringGetIntValue(CFSTR("0"))
<HR></BLOCKQUOTE>

<BLOCKQUOTE><font size="1" face="XYZ">quote:</font><HR>
CFRelease(NULL) crash too.

but there's a crashguard for it.
<HR></BLOCKQUOTE>

[ 12-10-2002: 留言編輯者: digdog ]

益智問答

發表於 : 12/10/2002 1:08 am
bryanchang
你就在叫 CFStringGetIntValue 前先檢查看看 CFSTR 是不是 "0" 後再去做轉換。

CFStringGetIntValue 會傳回所有可能的整數值,所以沒辦法用那個特別的數字表示有錯誤,在不增加一個額外參數來傳回錯誤值的情況下, 0 就被犧牲掉了。

以 TRU 的高見,你會怎樣設計這個 API??

[ 12-10-2002: 留言編輯者: 白萊恩 ]

益智問答

發表於 : 12/10/2002 1:18 am
the real unknown
根據本人的高見,它應該在發生錯誤時直接crash掉。
CRASH IT! BABY!

益智問答

發表於 : 12/10/2002 9:41 am
the real unknown
這個比較厲害。voi d...

蘋果保証這個function永遠不會發生錯誤,所以我們也不必浪費時間去檢查結果。

益智問答

發表於 : 12/10/2002 10:57 am
bryanchang
What kind of error could happen??

益智問答

發表於 : 12/11/2002 12:00 am
the real unknown
<BLOCKQUOTE><font size="1" face="XYZ">quote:</font><HR>原始發信人 白萊恩:
<STRONG>What kind of error could happen??</STRONG><HR></BLOCKQUOTE>

Who cares? Apple doesn't.