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

xStep

macrumors 68020
Original poster
Jan 28, 2003
2,031
143
Less lost in L.A.
Coworker had issue with an iPad running 7.0.2 and using edgesForExtendedLayout. Compiler error is "Property 'edgesForExtendedLayout' not found on object of type 'MyViewController *'". No, the subclass isn't really named MyViewController.

Oh, it also says; Use of undeclared identifier 'UIRectEdgeNone'.

This error only appeared when trying to compile with the iPad connected and as the target for debugging.

The code in question is;
Code:
self.edgesForExtendedLayout = UIRectEdgeNone;

I had iOS 7.0 on my iPhone and entered the same line for one of my view controllers in a different project. The code compiled fine with the device connected and being the target device.

I upgraded to 7.0.2 and now get the same error as my coworker.

The deployment targets for both our projects is iOS 5. Tried 6 and 6.1 with same result.

Anyone seen this problem and have a fix?

So far, if we make the deployment target iOS 7, the problem is resolved. These apps have the need to run on devices running less than iOS 7.
 
Last edited:

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
edgesForExtendedLayout is only available in iOS 7.0 or later. You can check for it at run-time using something like:
Code:
if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
{
    [self setEdgesForExtendedLayout:UIRectEdgeNone];
}
 

xStep

macrumors 68020
Original poster
Jan 28, 2003
2,031
143
Less lost in L.A.
edgesForExtendedLayout is only available in iOS 7.0 or later. You can check for it at run-time using something like:

Agreed that is the right way to check it, but that isn't my problem. The issue is a compiler error.

Also to clarify, the SDK being used is the iOS 7 one.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
I don't see how compiling is connected to which device is connected. I guess you are using the device SDK and not the Sim SDK, which are different in some ways.

You should be able to find where in the header files this property is declared and then you can find out why it thinks it's not declared.
 

xStep

macrumors 68020
Original poster
Jan 28, 2003
2,031
143
Less lost in L.A.
PhoneyDeveloper, I added the following to my .h file and it seems to work.

Code:
#import <UIKit/UIGeometry.h>

Worked in the other app too.

Thank you for the hint.
 
Last edited:

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
Typically your pch file will have

Code:
#import <UIKit/UIKit.h>

and that will import the UIGeometry header, as well as a whole lot more. Did you change that in some way? Or change a project setting to turn off the pch file?
 

xStep

macrumors 68020
Original poster
Jan 28, 2003
2,031
143
Less lost in L.A.
More mystery.

First, yes I already had;
Code:
#import <UIKit/UIKit.h>
No I don't use custom PCH files and I didn't alter the UIKit.h file. But...

I went to play with it again tonight and managed to get the error back even with the previous import I mentioned. Uh!

I noticed I have two iPhone selections for the target. (see attached image) One apparently points to the 6.1 SDK and the other points to the 7.0 SDK. No hint in the selection suggests this. When I choose the first one, I get the error. When I choose the second one the compiler works as expected.

I don't recall selecting the second one after adding that line, but who really knows now. :confused:

Is the double iPhone entries caused by having two SDKs installed? YES it is, and they appear in the order of the available and applicable SDKs. Only the newer ones that match or exceed the version of your deployment target will appear.

Will have to work with other developer on this to see his setup.
 

Attachments

  • Screen Shot 2013-10-15 at 11.53.48 PM.png
    Screen Shot 2013-10-15 at 11.53.48 PM.png
    49.6 KB · Views: 157
Last edited:

waterskier2007

macrumors 68000
Jun 19, 2007
1,871
228
Novi, MI
Is the double iPhone entries caused by having two SDKs installed? YES it is

You sure? Usually this just means you have multiple devices connected to your computer. I have two devices connected frequently, and they both show up in this section of that list, above the simulators
 

xStep

macrumors 68020
Original poster
Jan 28, 2003
2,031
143
Less lost in L.A.
Waterskier2007,

Yes, I am sure.

I did an experiment and added another iOS SDK to both Xcode 4.6.3 and 5. When I did that and restarted and plugged in the iPhone, I saw yet another entry.

Also note that the name that appears is the name you have given to your device. My other iPhone shows up as iPhoneDev and my iPod has another name. That makes it easy to select the desired device when more than one is plugged in.
 

firewood

macrumors G3
Jul 29, 2003
8,108
1,345
Silicon Valley
Installing the iOS 6.1 SDK in Xcode 5 is unsupported and reported (in Apple's dev forums, login required) to produce buggy builds. I would remove it, and/or reinstall Xcode 5 without it. Install and use Xcode 4.6.x if you need iOS 6.1 SDK builds (you can install two versions of Xcode on your Mac).

There are plenty of textview and UIView related anomalous behaviors in iOS 7 ( also reported in Apple's dev forums). Try submitting a bug report... it might get marked as a dup though.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.