ToolbarItem icon set after the loss - xcode

my English level is limited, it may be difficult to read, please understand.
I use the NSSidebarTemplate icon in the ToolbarItem control of the project. But every time you open the Xcode, will be lost, there is no way to use NSSidebarTemplate. The missing results are shown in the picture. Open the project will have a pop-up box prompts, probably meaning
The document "Main.storyboard" had an internal inconsistency that was
found and repaired.
I have no way to use this NSSidebarTemplate, but most of the other icons do not have such a problem, such as NSActionTemplate is normal

It comes from a template project from Apple. The image name is NSSidebarTemplate. You can see it by digging into the storyboard or xib xml:
<buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="NSSidebarTemplate" imagePosition="overlaps" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="zzz-zzz-zzz">
There might have been a change in Xcode that made the image name displayed as 'Unknown' at some point, though internally it's still there.
This is also discussed here: The Sidebar Icon image name in OSX

Related

Sublime Text 3 Theme: Some sidebar Icons not rendering

I'm writing a custom theme based on kkga's Spacegray theme, and I've run into an issue with the sidebar icons.
These are NOT the file icons feature, but the icons to denote if a folder is open/closed.
It looks like this:
However, when you hover over the rows, the highlighted row's icon renders just fine. Same image, and same path specification - so it's not an issue of the theme being unable to locate the file.
Can somebody more familiar with ST3 themes point me in the right direction to debug this issue?
ST3 Theme Docs can be found here: https://www.sublimetext.com/docs/3/themes.html
Ugh, I feel really silly. Turns out that the icons that were working, were cached versions (you can find the cache at /Cache/<package name> in the ST3 library folder).
I deleted the cache, reloaded the app and found that all the icons were not rendering. Realized that I had moved the whole package into the nested User directory recently, and as a result the texture paths were no longer correct.
Posting this for posterity. Mods, feel free to close this question.

Storyboards are missing in "copy bundle resources"

I'm using base internationalization to internationalize my app. Once I used it, my storyboards became red in "copy bundle resources" (they were normal before I used base internationalization):
I have tried Xcode Copy Bundle Resources can't find files, Base internationalization and multiple storyboard not working right and Base Internationalization and “Could not find a storyboard named […]”. unfortunately, none of them worked for me.
how can I make it normal?
edit
this problem still exists in xcode5
Make sure you have all the "Localizable strings" checkboxes ticked in the file inspector when the MainStoryboard file is selected.
I had a problem that looks similar. I transitioned my project's main storyboard to use base internationalization. When selecting the MainStoryboard file, in the file inspector, I saw a new entry called Base, which was using the English localization. So, thinking that "Base" already accounted for the english part I unchecked the English "Localizable Strings" entry in the file inspector. Apparently that was the origin of my problems. After that, the MainStoryboard file would show up in red in the "Copy bundle resources" list. Checking again the English localizable strings entry fixed the problem.
Unchecking "Localizable Strings" may need also first copy your storyboard elsewhere, then do the uncheck and then import your storyboards again in your xcode project.

WP7 - Not picking up embedded fonts

I have been trying to use some custom fonts within my WP7 app.
I followed the example as per http://www.jeffblankenburg.com/2010/10/24/31-days-of-windows-phone-day-24-embedding-fonts/ but in my project it simply will not pick up the custom font.
I have downloaded the sample project in this example and this one does work okay.
So, I have now used the same font used in there, and included in my project. I have ensured that the properties on the file are identical (Build Action = 'Content' and Copy To Output Directory = "Always")
I have used in my XAML in exactly the same way i.e.
FontFamily="Fonts/DigitalDream.ttf#Digital Dream" FontSize="24"
But to no avail. The custom font is just ignored. Is there something that I am missing, or a setting .. anything that would allow this to work in one project, but not another?
I have discovered that it will work if my XAML page is defined at the root level, i.e. immediately under the project, but in my case I have it in a 'Views' folder.
My understanding was that
FontFamily="/Fonts/DigitalDream.ttf#Digital Dream" FontSize="24"
should start at the root folder of the project?
thanks
Custom fonts can be a little tricky. I spent several hours once trying to embed an .otf font only to find that it just didn't seem to be doable.
You're on the right track, though. A .ttf font should be embedable. It's hard to get the right combination of paths and filenames to make the font work, though.
The easiest way I've found to handle some of these more difficult "magic string" type of situations in XAML is to let Expression Blend do the heavy lifting.
Here's a blog post about using Blend to embed fonts. The nice thing about using Blend is that it gives you some visual indications that things are set up correctly--i.e. you can see the font you want in the font selection menu. This is what finally clued me in on the .otf issue. I couldn't see the font in Blend.
And here's an example of a custom font that I've used in one of my apps:
<TextBlock Name="MyTextblock"
FontFamily="/MyAppName;component/fonts/Fonts.zip#Segoe UI Mono">
That's FontFamily URI is a pain to get right. I'm pretty sure that's your problem.
I was actually having the same problem. I followed everything to the dot and still I wasn't able to embed one particular font. So I created a new project and tried embedding the font there. Still no luck. I then tried embedding some other font. And lo and behold, as soon as I typed the FontFamily attribute, I could see that it had embedded. This was particularly odd since I didn't have to change any properties of the font.
I opened the project in Blend and clicked on the font property box to the right. It took a few seconds and then it embedded the font I was having problems with in the first place.

Stanford's initial assignment not working

Stanford put out for free a series of videos and handouts for their iPhone programming course. I've played around with the first assignment, but all I get on the Simulator is a blank screen. Here's the recipe I followed; what am I missing?
In Xcode, create a new Window-Based iPhone application.
Open the project’s MainWindow.xib file with Interface Builder.
Add the following user interface elements to the view:
a text label
an image view
Set the following properties on the text label:
text value should be “Hello Stanford!” (or something suitably amusing)
text alignment should be centered
adjust the size to make the text large
Back in Xcode, add an image (.png or .jpg) to your project. You can use the Project > Add to Project... menu to select an image. Note: Be sure to check the “Copy items into desti- nation group’s folder (if needed)” checkbox.
Once your image is in the project, return to MainWindow.xib, select the image view and set the image for the image view that you dragged in previously using the Attributes Inspector.
Configure the image view’s “Mode” to be “Aspect Fit”
In Xcode, build and run your project in the simulator.
Been there, done that, but no t-shirt. Seems to me I'm missing connecting lines in the Interface Builder, but I see nothing in the recipe about that.
Since you didn't provide a link, I'll assume you're talking about this document.
Works for me on XCode 3.2.3/Snow Leopard 10.6.4. I created the project as iPhone-only, as opposed to Universal, but it shouldn't make a difference for your purposes.
Try again from scratch, or take a look at my project here.

Interface Builder doesn't show some of my resource images

I have almost 20 images in PNG format added to my current project on Xcode (under the proper group, Resources). Unfortunately, library window's Media tab doesn't show some of them. And if I create an UIImageView and set one of these invisible images from code, nothing shows up. I also tried from IB with adding a UIImageView and set its source image.
Is this problem a image format related issue or is there a tiny detail I'm missing.
What log says:
Could not load the "07_clock_icon.png" image referenced from a nib in the bundle
The solution to this is a bit silly, but it definitely works:
Close XCode and the Interface Builder. Now, instead of opening XCode then opening the project, navigate to the project in Finder and double click on the project. When you open your xib file the blue file not found images will flash up, then be replaced with the correct images and the dropdown will show all your images in the Inspector.
Heyy! I figured it out. It's a refreshing bug. So just copy and replace those images that did not load into your project folder, and then hold Shift Command K (to clean your project). After Clean Up it should work perfectly! Enjoy!
If you dragged the images from the Finder into the Resources folder in XCode the images should show up in IB as well. At least it does so in my setup.
Maybe the images are 8-bit PNG images. I believe Cocoa requires them to be 24-bit because of the alpha transparency. PNG 8-bit doesn't support the alpha channel, as it's more like a GIF image.
But from the error you posted It seems IB couldn't find the resource at all. Which is understandable if it doesn't load the resources from XCode in its library.
Assuming you selected the option to let XCode copy the files into your project and neither XCode nor the Finder complain when you make the copy... I wonder if there might be some file corruption? Maybe try recreating them or opening and resaving them from another graphics application (or even Preview.app).
btw- 8-bit PNGs have worked fine for me.
Same problem was encountered by me. The problem is with the image. The image has been some how corrupted.Try to open the image in photoshop and you will see it doesn't open with photoshop.
I solved the problem by changing the image format to PNG-24 and everything works fine for me.
Hope this will solve your issue.
Regards,
Rupesh R Menon

Resources