Why does Cocoa return an empty string occasionally?

后端 未结 2 1663
春和景丽
春和景丽 2021-01-06 02:52

I have some code in my application that looks something like this:

char *hash = (char*) sqlite3_column_text(get_bookmark, 0);
NSString* postHash = [NSString          


        
2条回答
  •  -上瘾入骨i
    2021-01-06 03:23

    However I find that postHash is an empty string (@"") for some users some of the time.

    Can anyone explain why?

    Because hash is an empty string (hash[0] == '\0').

提交回复
热议问题