Clear an IKImageView? - objective-c

I have an IKImageView set up to display in my mac application but when you don't give it an image, its starts with like a noisy broken screenshot of my own desktop rather than being empty. How can I simply clear it and have it empty?
Thanks.

Only display it IF you actually have an image. If you don't have one just show the user a label or something saying 'No Image' or similar.

Related

how to add text on image and move that text to different points(objective-c)

I want to add text on image, not on a specific point but want to move it anywhere on the image. just like many photo editing apps. anybody know how to do this?
You can set label on UIImageView and then you can write whatever you want to write.
https://github.com/kcandr/IQLabelView
This one is the best approach and it worked fine for me by making the required changes to the code.

Anchor settings not working

My VB.Net application is using anchoring to force certain controls to resize to their container, eg a list box on a form. This is all pretty standard and easy to do. However having just released the application into production I've found that on one user's computer the anchoring seems to just be ignored. She has Windows 7, as do I.
So far example what should look like this:
instead looks like this
I asked her to try a higher resolution on her screen but that didn't to help.
On one of them I was able to fix it by manually setting the width and height in form load properties of the control instead of anchoring it, but it seems a bit backward.
It looks to me like the form has been resized to be too small for the anchoring to work correctly. Set the .MinimumSize property of the form to ensure the form does not get too small for your layout.
Older staff sometimes reduce the screen dpi to make text easier to read, which means the screen may not be big enough to display the form. To fix this, set the screen dpi back to something reasonable and increase the text size for readability.
Turned out to be that the display issues were caused by user having the "Font Size" setting on her computer set to 200%. To be honest I didn't even know you could do that.

Widget Simulator does not display elements of "Today Extension”

I want to implement the “Today Extension” feature into one of my applications. I successfully added the extension, gave it a run and saw the “Hello World” screen on the simulator. I then deleted the "Hello World” label, and added my own labels to the view. Nothing spectacular and really nothing I thought which would make me any trouble…
Now when I run the widget all I get is an empty Simulator:
Things I tried:
Checked that "File’s Owner" has the view connected
Coloured the labels and made sure they aren’t hidden
Checked if the view’s controller gets initialised accordingly
Fiddled around with Autolayout: The extension view does look like a (too) small bar compared to the size I assigned. The strange thing is, that even if I drag one label to the top, it does not appear
Tried a “Clean” and “Clean Build Folder” and also “Clear Snapshot” in the simulator
Downloaded a working today extension from Github to check if I did something wrong. Couldn’t find anything.
It does seem like I’m working on the wrong view. But it is in fact the same view which displayed me the “Hello Word” label. Am I missing something? (#Moderator: I suggest adding the following tags: osx-today-widget, widget-simulator. Thanks in advance.)
Without the code it is hard to say, but maybe this helps:
what text color does your label have?
make sure to give it "Control text color"
what is your minimum height>
click the "Custom view" in your xib file (the root view) and click Editor > Pin > Height.
Set it to 200 and "greater or equal than"

Cocoa: Obtaining an image that's displayed in another application

One Google Chrome extension displays a window with an image once in a while, how can I get the image from it with Cocoa?
Basically there is a window and image inside it, and I need that image for my program.
Thanks for reading!
Use CGWindowList to get all the windows in the current session, look through it for the one you're interested in, use CGWindowList again to take a screenshot of it, and cut the image out of the screenshot.
If the window is sized and/or scrolled such that the image is not completely visible, you're out of luck.
There is no way to extract the original image from a window it might have been drawn into.

Use a button to change the orientation of the iPhone

Is there a way to change the orientation of the iPhone using a button?
No. flip the phone, the orientation changes. Leave it at that, or you'll ruin the integrity of the phone.
sometimes we need to show our app in the correct orientation, even if there is not direct way on doing what domness want, you can look at this SO entry and see some responses.
P.S. # domness, try to search for what you need before posting a new question.
What exactly are you trying to reorient? You can change the position of the status bar with UIApplication -setStatusBarOrientation:animated:; rearrange your UI with the proper transformations and you'll pretty much have it.
You can force an orientation change, but only using an unsupported, private API. If this is something you'd like Apple to make public, you should file an enhancement request.
This is my new account btw..
Right, I got this sorted by apply the transformations to what I wanted to show when the button was clicked. It was to show a scrollview with applied animations to objects within the scroll view.