Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
A quick one - I know that this has been asked a number of times but I can't find the answers on here. I have started a new project in Xcode and when I resize objects they resize from the other side of themselves, the controller moves with it etc. I know it is a simple setting somewhere but I can't find it - any helpers?
Your view controller is probably has auto layout enabled. When you resize one view, the others are resized according to their constraints.
To turn off auto layout: Select the view controller in IB, and in the properties pane on the right, open the first tab, and uncheck the Auto Layout checkbox.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have start programming a simple game. I don't use sprite Kit because it's very simple to use sprite Kit. But I have a problem with the levels. For now I'm using a lot of UIviews for levels, if level 1 is completed the next UIView with the second level is shown. Are UIViews a good idea for Levels ? Or is there a better way to add levels in simple game ?
It's rather a very bad idea to use UIViews as adding subviews and removing them can make your game sloppy. Instead what you should do is create a new ViewController and according to the levels you can set the level and other properties in the prepareForSegue method. I am listing some links here which will help you to learn about the topics :
Multiple ViewControllers
Segues
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
The answer given to How do I create an iPhone app with background and rotating images? says, "then on Interface Builder or the Storyboard, from the Library drag an Image View (also called UIImageView) and place it on your canvas,"
I'm new to IOS. How do I "from the Library drag an Image View"? I've looked around through the interface, and do not see an opening to the Library from which I can drag an Image View. On the LHS of the screen there is a Frameworks folder that lets me select a UIImageView.h and try to drag it (I can't drop it on the storyboard).
How do I navigate to and manipulate the Library in Xcode so I can drag a UIImageView / Image View onto the storyboard?
Hit Cmd+1 to show the project navigator
Select the storyboard file to open it
Hit Ctrl+alt+Cmd+3 to show the object library (appears at the bottom left corner)
look for the Image View item in the list (you can filter the list using the search field)
drag this object into the canvas or the document outline
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Have a way to I block hide the NSMenu after click.
Thanks.
No, I've written several menubar apps and I've found the only way to disable menu-closing is to subclass NSMenuItem and do your own event handling. Unfortunately that also means you have to use a custom view, do your own title drawing, menu highlighting and "flash" animation.
Another option is to switch to a view based menu item. Then in your view class, respond to - (void) mouseUp:(NSEvent*) event and implement your custom behavior. The menu will not close on the click, as the event is no longer forwarded up the responder chain to the menu item.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
This is a newbie question!
How to Create And Display a Custom Sheet in Cocoa? (like "Add Bookmark" sheet in Safari - see below)
What are the steps involved in the task?
How to accomplish each step?
Can you point out a good step-by-step article?
alt text http://grab.by/2oWw
All you need to do is make a nib file containing an NSWindow that you want to use as the sheet, and load it up. Check out Using Custom Sheets in the docs.
NSApplication has a method to let you load the sheet up:
beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:
This page has some more information and what I'd consider an easier way to set up the sheet - making it a panel or window inside the same nib file as your document window.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I want to create analog of program conky. What is the best way to draw information on a OS X desktop?
NSWindow has a method, setLevel:, that lets you control how the window is positioned compared to other windows. From my own experience, you might want to try feeding it kCGDesktopIconWindowLevel, and calling setHasShadow:NO to implement the look you want. To actually do the drawing you would put a custom NSView subclass in your window, and create the window without a frame (see NSBorderlessWindowMask) and transparent ([window setBackgroundColor:[NSColor clearColor]], [self setOpaque:NO];).
You might also want to take a look at this article to keep your window pinned to the desktop during an Expose event.
Have you tried GeekTool? Maybe you don't even have to write the app. ☺
You need to take a look at using NSWindowLevel with a transparent window.