我有一個使用一堆PNG文件的工作應用程序;它運行沒有問題。我只是從iconfinder.com下載了兩個圖標,並且無法將它們加載到我的應用程序中。iphone uiimage not loading
這裏是我的代碼:
showKeyboardImage = [UIImage imageNamed:@"Bonjour.png"];
printf("Bonjour %p %g %g\n", showKeyboardImage, showKeyboardImage.size.width, showKeyboardImage.size.height);
// http://www.iconfinder.com/icondetails/36137/32/add_keyboard_icon
showKeyboardImage = [UIImage imageNamed:@"1342878368_keyboard_add.png"];
printf("showKeyboardImage %p %g %g\n", showKeyboardImage, showKeyboardImage.size.width, showKeyboardImage.size.height);
// http://www.iconfinder.com/icondetails/36138/32/delete_keyboard_icon
hideKeyboardImage = [UIImage imageNamed:@"1342878356_keyboard_delete.png"];
printf("hideKeyboardImage %p %g %g\n", hideKeyboardImage, hideKeyboardImage.size.width, hideKeyboardImage.size.height);
下面是輸出:
Bonjour 0xbd33f70 32 32
showKeyboardImage 0x0 0 0
hideKeyboardImage 0x0 0 0
是,所有這三個文件在同一目錄下。是因爲我從互聯網上下載了圖標嗎?我需要標記他們安全使用或什麼?
在你的模擬器或iPhone上發生問題嗎? – 2012-07-21 18:53:04