Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

salvadormg

macrumors member
Original poster
Aug 19, 2009
35
0
Hi,

I want to create a view with a few pictures on it and words and text, but any time i put them near each other i just get errors everywhere... can anyone tell me how to fix this?? This is what i get....
 

Attachments

  • Picture 2.jpg
    Picture 2.jpg
    74.8 KB · Views: 95
Well, it doesn't want you to have sibling views that are one on top of another. You can make one view a subview of another view.

BTW, I recommend that you don't put your project folder inside /Developer I have a develop folder inside my home folder and put project folders inside that.
 
Well, it doesn't want you to have sibling views that are one on top of another. You can make one view a subview of another view.

How do i do that may i ask... :confused::eek:



BTW, I recommend that you don't put your project folder inside /Developer I have a develop folder inside my home folder and put project folders inside that.

Why is that? Works fine for me?
 
but any time i put them near each other i just get errors everywhere...
Hmm, my info window shows that issue as more of a warning (with an 'i' in a blue circle) than an error ('x' in a red circle). Regardless, you can probably just ignore it as long as things seem to be working ok. Wow, I didn't even know anybody really looked at that Document Info screen.
 
How do i do that may i ask...

You can drag one view onto another view in the View window or you can do it in the nib windiw. Make sure the View Mode is set to list view in the nib window. You'll see all your views listed there in a hierarchical way. Just drag one view up and down the list to make it a subview of another view. There are a few kinds of views that don't allow having subviews. I think that UIImageViews is one of these.

All those views that you show in the screenshot have to be inside another view object, right?

Why is that? Works fine for me?

There will come a day when you need to delete /Developer because your Xcode installation is fubar, or you just want to make sure to get a clean update when you get a new version of the SDK. If you have your projects inside there you might do something you'll regret. Or you do an install of a new version of Xcode and your project folders just vanish. /Developer belongs to Xcode. Put your projects somewhere else.
 
i Still haven't gotten this working, does anyone no how to do this? I have a view, i put an image in the back, a few buttons, but if one button goes over the image i get an error that says illegal geometry! How do i fix this to layer up buttons and images?
 
As stated in the documentation for UIView (2nd paragraph, last sentence): "Sibling views are able to overlap without any issues, allowing complex view placement." So, just ignore it!
 
While I would try to minimize overlapping views if you need to place views on top of an imageview you're going to get these notices. I would probably ignore them also.

You may need to set the severity of these issues in the IB prefs window to Note, and not Error.
 
While I would try to minimize overlapping views if you need to place views on top of an imageview you're going to get these notices.

is it because overlapping views reduces performance? i have several "complex" IB views, and a long list of illegal geometry notes to prove it. i just always ignored them since the programs always executed perfectly in both simulator and on device. i even receive illegal geometry notes for placing UILabels over UIImageViews, which never really made sense to me.

so why would you discourage overlapping of views?
 
On Cocoa on the Mac the drawing order of sibling views is 'undefined' so the appearance of overlapping views is considered to also be undefined. On UIKit I guess this isn't the case.

My reasons for trying to avoid this aren't well defined. Mostly I don't like to see errors or warnings if I can avoid it. I'll assume that there's a reason from Apple that they want views to be a certain size and to have a certain amount of space around them. Partly it's for appearance.

In the case the OP describes where he wants controls on top of an image view I guess there's no other option. I can say in my code I have one case where I layer an activity indicator on top of other views in an overlapping manner. I don't have another way to display the indicator.

As you know, Apple can change things at any time. They're more likely to change things that they've been giving warnings about.
 
On Cocoa on the Mac the drawing order of sibling views is 'undefined' so the appearance of overlapping views is considered to also be undefined. On UIKit I guess this isn't the case.

My reasons for trying to avoid this aren't well defined. Mostly I don't like to see errors or warnings if I can avoid it. I'll assume that there's a reason from Apple that they want views to be a certain size and to have a certain amount of space around them. Partly it's for appearance.

In the case the OP describes where he wants controls on top of an image view I guess there's no other option. I can say in my code I have one case where I layer an activity indicator on top of other views in an overlapping manner. I don't have another way to display the indicator.

As you know, Apple can change things at any time. They're more likely to change things that they've been giving warnings about.



Has anyone gotten there App into the App store with these errors? Does Apple not care if there is an error on the views in an app? If so why the hell put them up?! I did also notice the App runs perfectly even with the errors i just prefer to send them off to Apple perfect with not one error! Guess thats just me?! :eek:
 
Has anyone gotten there App into the App store with these errors?
Yes. I know I have. In fact, I wouldn't be surprised if over 90% of the apps available out there have these kinds of "errors" (more on that later).

Does Apple not care if there is an error on the views in an app?
Almost certainly not. I bet they are not even checking for these "errors" (more on that later).

If so why the hell put them up?
Just to bug you, I'm guessing. :D

I did also notice the App runs perfectly even with the errors i just prefer to send them off to Apple perfect with not one error! Guess thats just me?! :eek:
If your App runs perfectly, no worries, mate! Look, you have three options here: 1) learn to ignore them (i.e. don't even open that window anymore) and life will continue just as before (trust me), 2) change your Interface Builder preferences so that Illegal Geometry alerts are just Notice severity (somehow I think mine were always like this), or 3) re-do your UI so you have no overlapping siblings.

Really, for iPhone development these are not "errors". Interface Builder really should just treat them like Notices and you should learn to ignore them unless they are causing you some related issues.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.