Interface Builder refuses to see "@2x" image files - AGAIN in 5.0

This was a problem in Xcode 4.0. Eventually, it was fixed.
Now that Xcode 5.0 is out, it's back to the same problem. And, Xcode 5.0 asks you to convert your XIB files to the new format, so it can screw you up without you even knowing it!
PROBLEM:
The @2x images are NOT visible in interface builder. It cannot be selected from the list. It shows an unknown image (question mark) if you manually type it in...which renders layout design pointless if you need those @2x files.
Many, many, many developers reuse the @2x images in the iPad xib files. Now, all of the images will either be shrunk or stretched from lower-res images...because it REMOVES the @2x extension for any images it finds in a xib file.
SUGGESTIONS in the past:
- Copy your @2x images to ~ipad images, because the framework will automatically use it.
NO. I don't need to up the size of my app significantly with duplicate images.
- Rename the @2x images to something else (e.g. -2x).
NO. Because the framework will no longer auto load them for iPhone retina.
- Just manually name them with the @2x and live with the broken image in IB.
NO. Because most people actually care about the layout.
- Create a separate iPad app.
NO. Because customers shouldn't have to pay twice for the same app for 2 different devices.
- Programmatically change the images to @2x if it's an iPad.
UGH. This is what I've ended up doing, but how ridiculous is that?
Anyone else found a way around this?

  NSString* path = [[NSBundle mainBundle] pathForResource:@"imageName" ofType:@"png"];
          NSData* data = path ? [NSData dataWithContentsOfFile:path] : nil;
          UIImage* img = data ? [UIImage imageWithData:data] : nil;
  if( img ) [button setImage:img forState:UIControlStateNormal];
OR
  NSString* path = [[NSBundle mainBundle] pathForResource:@"imageName" ofType:@"png"];
  UIImage* img = [UIImage imageWithContentsOfFile:path];
  if( img ) [button setImage:img forState:UIControlStateNormal];
Both should bypass auto-scaling.

Similar Messages

  • Interface Builder refuses to see "@2x" image files

    I'm making some apps with support for all three major iOS platforms: iPhone&Co, iPhone4 and iPad. This support means, naturally, having larger-resolution images for the latter two platforms. Currently I'm making the apps universal, so the same app will run in all of them.
    Since most of the double-resolution images of the iPhone4 version of the app can be used as-is in the iPad version (only things like background images have to be made separately for all three types of platform due to differing screen resolutions; the rest can be done with simply laying out the elements appropriately in the iPad as compared to the iPhone4, using the same element images for both), it would be a huge waste of space to make separate images for the iPhone4 and the iPad, when these images would be completely identical. Thus it only makes sense to reuse the same "@2x" images of the iPhone4 on the iPad version of the app.
    This worked nicely for a while. However, at some point quite suddenly (I don't really know what happened), Interface Builder started to completely refuse to see any image files with a "@2x" in their name. It won't show them on the drop-down menu where you select an image (eg. for an UIImageView or UIButton), and if you write it manually, it will refuse to show it (only showing the question mark image symbolizing a missing image file). The image will show ok when running the app, but IB simply refuses to acknowledge the existence of such images. If I rename the image such that I remove the "@2x", then IB will accept it, but not if it has those characters.
    As said, IB did see the "@2x" images at some point, but for some reason now it doesn't. (This is a bit of a mystery because I don't remember this happening after any kind of SDK upgrade or anything.)
    This tells me that this is either 1) a bug in IB, or 2) intentional behavior, and the "@2x" images should not be "abused" in this way to create an iPad version of the app properly.
    If hypothesis 2 is correct, then what is the proper way of using the same images in both the iPhone4 and iPad versions of the app? Duplicating the image files would be an enormous waste of space (the apps are quite graphics-heavy).
    One "kludge" that comes to mind would be to create soft links for the images so that the iPad versions of the image files would just be soft links to the @2x iPhone4 images. However, I don't know if the bundling mechanism of the iPhone SDK supports soft links, or if it will simply make copies of the images (in which case each such image will end up being stored twice in the bundle).

    WarpRulez wrote:
    If I rename the image such that I remove the "@2x", then IB will accept it, but not if it has those characters.
    I guess I don't understand why you want a solution when you've found one already.
    Just use ".2x" or "-2x" or whatever.
    Report the bug, use your workaround and move on.

  • When a pop up window comes up it is - search bookmarks and history window! I cannot log into my bank as login button should open new window to log in but I get the search page. I cannot see larger images as again I get the search bookmarks and history pa

    When a pop up window comes up it is - search bookmarks and history window! I cannot log into my bank as login button should open new window to log in but I get the search page. I cannot see larger images as again I get the search bookmarks and history page etc. Happens on all options that should open new page. I am so frustrated, this has been happening since Firefox updated itself 2 days ago to Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 ( .NET CLR 3.5.30729; .NET4.0C) was fine before that. using windows vista. Can you please advise what I should do? Also can you go back to previous version? Error console eg
    Warning: Error in parsing value for 'cursor'. Declaration dropped.
    Source File: https://ib.nab.com.au/nabib/styles/menu_nab.css?id=009
    Line: 116
    ib.nab.com.au : server does not support RFC 5746, see CVE-2009-3555 and Warning: Selector expected. Ruleset ignored due to bad selector.
    Source File: https://ib.nab.com.au/nabib/styles/nabstyle.css?id=014
    Line: 837
    == This happened ==
    Every time Firefox opened
    == 2 days ago after update.

    Do you have that problem when running in the Firefox SafeMode?
    [http://support.mozilla.com/en-US/kb/Safe+Mode]
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this:
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • How to see all image file types when saving images without selecting "all files"

    Hallo, and thank you fom reading.
    I am a person who saves a lot of images online in different folders with different names like G - 456 or F - 35.
    I have been using firefox 10.0.2 for a long time because of a bug (I guess) that made it easier to save images.
    When I saved an image it would always show me all the image files in any folder I wanted to save it, and that way making it easier for me to save files with the right names.
    Now with the newer firefox (currently 19.0) whenever I try to save a JPEG I only see the JPEG files in the folder and only way to see the others is by selecting "save as type" all files, but with this I also see all the files that are not images.
    This used to save me a lot of trouble and a bit of time but I dont see anything in the options menu that can help me. Is there a way to recreate this function?
    Thank you for your time.

    I suspect this is a Windows problem. I am surmising the FilePicker uses the Operating System or Desktop facilities. Does Windows 7 offer any other file categories like ''images'' ?
    I do not normally use Windows 7, but may the option depend upon the directory being an indexed one, I ask after finding this thread ''Bring File types tab back'' [http://www.windows7taskforce.com/view/819]
    This question is a duplicate of [/questions/951764]
    Normally I would lock the duplicate question, but in this instance I will leave it open as it is unanswered and someone may give a better reply.

  • Vision Builder AI and multiple cameras/image files

    Hi,
    We are trying to develop an inspection using Vision Builder for AI with 3 1394 cameras.
    We have setup the image output to save all images from the inspection, however it only saves the last image acquired during the inspection.
    Is it possible to have Vision Builder save the images from the other 2 cameras?

    VBAI only has the ability to save the last image. If you would like to save the other images you will need to port the inspection to LabVIEW, and use Vision to save the other images. The other option is to create inspection scripts for each of the cameras.

  • Interface Builder w/ Xcode folder refs

    when i set up xcode with folder refs interface builder does not see my images in the dropdown list. i actually have to type out the path and ib will show a broken image. is there anyway to fix this?

    Note that *AppleScript Studio* has been deprecated in Snow Leopard - AppleScriptObjC is the new framework. You can still edit Studio projects, but the project templates have been removed and you will need to enable the AppleScript palette - see the release notes.
    Assigning a handler (IBaction) to a button (or any object) is pretty easy - create a handler in your script that takes a single parameter and name it with a trailing underscore (the naming conventions are also in the release notes), for example:on doButtonStuff_(sender) it will appear in *Interface Builder* under the *Connections Inspector* for your application delegate - from there you can make a connection from your object to the handler. MacScripter has some tutorials for AppleScriptObjC in Xcode, and I also have a button example project (it's not much of a tutorial, though).

  • Xcode 3/Interface Builder - Adding classes to NIB file doesn't work

    I'm attempting to learn Objective-C and Cocoa GUI through Apple's "Currency Convertor" tutorial. I'm currently at the "Add the ConverterController Class to Your Nib File" step, and I add ConverterController.h to the Interface Builder project (both by Read Class Files and dragging) and... nothing happens. The tutorial clearly states that the class should appear as a new icon in the MainMenu.nib window. I've tried researching this problem, and it appears to be quite common, however every fix isn't really a fix at all. They all involve using the Identity Inspector for something, which appears very complicated, and is otherwise uncovered in the tutorial. It occurs to me that anyone knowing enough to be able to use this fix wouldn't be reading this tutorial, thus making such answers moot. Any help anyone could provide on this issue would be appreciated.

    The tutorial you linked to should work fine except that they've just got the illustration (Figure 5-3) in the wrong place.
    The placement of that illustration implies that you should see the instance of your class in the MainMenu.nib window right after doing step 2 (where you read your class file). But that's not really true. In reality it's step 3 that gets you the blue box in the MainMenu.nib window and steps 4 and 5 that will transform it from an "Object" into a "ConverterController". Steps 3, 4 and 5 are exactly what Thomvis suggested that you do earlier.
    Steve

  • The URL in the web interface builder

    Hi
    In the web interface builder in BPS there are several components.
    When I click on them one by one I can see the planning functions and other details.
    There is a URL present in the web interface builder which corresponds to upload flat file data.
    How can we trace what are the planning functions used for this link.
    If we go to se80 how can we find whats the applicable BSP page for this particular URL which corresponds to a planning function.
    Please advise.
    Many thanks.

    Hi,
    From URL you can't find the details of planning objects. BUt you can find the BSP application that gets executed from that link and in that BPS application you can see the planning objects that are used in various events to upload the file data.
    Regards,
    Deepti

  • My image files will NOT show up when I import them

    I CANNOT see my image files when I import them. This is the case regardless of whether I import them directly from my image files, or from my Flash library. They WILL NOT show up in the stage area, although the panel on the right shows the file! What can I do to correct this? I am using Flash CS4 which I need for my Digital Design classes through the Art Institute of Pittsburgh! I will FAIL this course if I can't get this program to work properly!!

    Here are a few things to check:
    Do you have anything else on Stage that might be covering them up? Is your target layer locked? Is the layer visibility turned off?
    Are you doing this in an existing document, or a brand new document?

  • P2 Panasonic log and transfer, FCS refuses to see....

    hi,
    this is driving me crazy...I have looked all over the web, and all tutorials seem straight forward, and I have followed them, but my FCS refuses to see the P2 files. I open Log and Transfer and they don't show up.
    Well they did, the first 2 times, but now I have been at it for 2 days with no success.
    I have trashed my prefs, I have restarted, to no avail.
    But what is very strange is that the first time I try it it actually worked.
    Any ideas?

    found the answer on this page:
    http://lfhd.blogspot.com/2007/11/fcp-602-busted-p2-import-one-fix.html
    FX Factory was the culprit
    man did I read many pages to find the solution, uninstall FX Factory and it worked right away.
    Thanks to Shane Ross

  • Image File Encryption

    Just like most on the forums around the net, having serious issues with BB encrytption of jpg's. BB stopped working and transfered all 400 pictures off of it (thankfully) to my Mac. I could not view the .jpg.rem images on my Mac, however I figured I would let it lie based on most of the posts. Got back my BB and transfered the images back onto the BB and all I see are image files with hourglasses? Tried turning off and on encryption, tried renaming and transfering files, emailing them, switching folders and just about every possible combination...to the point where I see that the "damaged or corrupted" error.
    I still have the original transfer of files to my Mac, is there anyway I am ever going to see these pics again?

    Nope, sorry. The encryption must be removed while on the SAME device, with the SAME operating system which contains the encryption keys. Once the device was wiped and the OS reloaded, those files are worthless.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Image file problem

    I have developed a servlet program, which receives image from its client in a stream. The received size of the image (byte array) is 16180 bytes. But when I write the image into a file, the file size is 17190bytes. Where do these extra bytes come from? Can i get my 16180bytes exactly same as received from client when I read the image file again? I am runing my program under windows. Can some one help me on this? thanks..

    I have developed a servlet program, which receives
    image from its client in a stream. The received size
    of the image (byte array) is 16180 bytes. But when I
    write the image into a file, the file size is
    17190bytes. Where do these extra bytes come from? Can
    i get my 16180bytes exactly same as received from
    client when I read the image file again? I am runing
    my program under windows. Can some one help me on
    this? thanks..The extra size is from header information that most (all?) image formats have, such as the size, compression data, type, etc..

  • Set background image in the Interface builder

    Hi,
    Is there a way to set a background image for a View controller through the Interface builder? I'm using story boards.
    If not please tell me how to do that programatically. I need to set this background image for all my UIs.
    Thanks

    Remember that the client is running from a browser. You need to have the file be available to the browser and that means having it be served by the web server. Place the image file in a directory available to the web server and map that directory to a virtual web server directory and specify it with a url relative to the web server root: /images/your_image.gif

  • Interface Builder does not open when I click Mainwindow.xib file on Monotouch.

    I did a lot research about it, What the most of view say it is because of the iOS SDK, not because of the MonoTouch, they say that iOS SDK provides the Interface Builder? Any suggestions? Thanks in advance. iOS SDK Version 4.3.

    Does Monotouch work within Xcode? I'm not sure what it is. If so then Interface Builder does not open a separate window in Xcode 4. When you first go to your .xib, you must select your "Window" to see the window. Otherwise you get an empty grid. Here's an image with the "Window" selected. I have it set for Mac applications not iOS but what you have should look similar.

  • Interface Builder - Custom images not visible in Cocoa Simulator

    I'm very new to this, and just toying around with Interface Builder more than anything at this stage…
    Anyway, my problem… I've created some of my own images to place on buttons, etc. I've saved them in PNG format and dragged them into the Resources folder of my Xcode project, so they become available in Interface Builder's media library. I can drag them onto my window just fine, but when I test the UI with the 'Simulate Interface' command, the images disappear completely.
    Any ideas?

    This was changed in Interface Builder 3.0. Now, you have to click on the "Connections" tab in the object's Info panel. I think it is the 2nd one from the right. You will recognize it because you will see all your outlets. You click the little circle next to the outlet and drag a line over the user interface object to make the connection. Once you do that, there is a bug in Interface Builder that will blank out the info panel. You will have to select some other object to redisplay any information, then click back to your original object. The bindings panel has a similar set of bugs. Suffice to say, Interface Builder 3.0 is a work in progress.
    PS - to break a connection, click the little X button next to an outlet name.

Maybe you are looking for

  • Trial version is out of date.  When will 10.0.7 be available for trial?

    I'm using the trial version (10.0.6) and found a bug burning single layer DVDs, also reported and discussed extensively on this forum. Supposedly this is fixed in 10.0.7 (or so the release notes claim)  But I'm understandably skeptical. I'd like to T

  • Creating structured texts for purchase requisitions

    Hello, I would like to know if it's possible to define structured texts for purchase requisitions. By example, the item text would be like this : Building : Room : and the user should only complete the missing information. Does anybody have an idea o

  • Resize flash movie.

    Hi friends,                Actually my doubt concerns with resizing a flash movie when a browser resizes. The flash movie is a slide show. In flash I have scripted to resize the image using onResize event. Also it's working finely when opening on fla

  • Errors in odi 11g

    hi friends. what are the errors in odi 11g and how to handle these errors?? please refer some site for it. thanks.

  • Resize windows to fit greyed out in photoshop

    Hi - the 'resize windows to fit' is greyed out in photoshop Any ideas on how to solve this?