XCode5 Error: "use of undeclared identifier uistatusbarstylelightcontent" iOS6 deployment - iphone

I've been working on a project where the deployment target is iOS 6 but the Build Settings/Base SDK is iOS 7. I was returning UIStatusBarStyleLightContent from (UIStatusBarStyle)preferredStatusBarStyle and the project was compiling.
I tried wrapping the offending code in compiler #if statements like this:
- (UIStatusBarStyle)preferredStatusBarStyle
{
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
return UIStatusBarStyleLightContent;'
#else
return UIStatusBarStyleBlackTranslucent;
#endif
}
But then I got the same error for other identifiers like 'tintColor' and 'cornerRadius' for CALayers.

Initially I was searching for an accidentally changed project setting, but I couldn't find any and my .xcuserdata is in my git ignore file. I added the iOS 6.1 SDK to my XCode 5 installation to compile another test app to my iOS 6 test device last night, so I tried removing that folder from XCode 5's library. Even though I wasn't explicitly targeting the iOS 6 SDK (it was my Deployment Target not Base SDK) XCode was looking at my code as if it was iOS 6 and throwing errors for all my iOS 7 code.

Related

Cant build ios project, no such module or this SDK is not supported by compiler

So I got an demo ios project from different company but I can't launch it
Basically i get two errors:
Sometimes I also go an unsupported swift architecure error
I work on M2 processor and use XCode 14.2
Project does not have pods, all packages are managed via spm (that's what I was told)
For now i tried:
opening xcode via rosetta (nothing changed)
changing version of xcode to 14.0 (nothing changed)
using other swift version via toolchain (Swift 5.7), screen below ( get different erorrs but i dont think its a good way)
UPDATE
I downloaded version 14.0 of xcode and toolchain 5.7.2
When i use that version of xcode i get an error about missing classes from that sdk in scope and also some weird error from SentrySamplingProvider ( screens below)

Distribute Universal framework written in Swift

I'm facing the issue with distributing compiled swift framework. My framework heavily relies on the libxml2 dynamic library. In order to avoid issues with Swift module compatibility, I've set build flag BUILD_LIBRARY_FOR_DISTRIBUTION = YES.
So I've used Xcode 11.3 Swift v5.1.3 to build my framework. I've integrated it into the Demo.app project. As being expected Demo.app works fine in Xcode 11.3.
However, I have another error trying to build Demo.app in Xcode 11.0 Swift 5.1.
I've got the error:
#import "libxml/HTMLparser.h"
^
/Applications/Xcode_11.0.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator13.0.sdk/usr/include/libxml2/libxml/HTMLparser.h:15:10: error: 'libxml/xmlversion.h' file not found
#include <libxml/xmlversion.h>
^
/.../DemoApp/ThirdParty/testXML.framework/Modules/testXML.swiftmodule/x86_64-apple-tvos-simulator.swiftinterface:6:8: error: could not build Objective-C module 'libxml2'
import libxml2
^
/.../DemoApp/AppDelegate.swift:11:8: error: failed to load module 'testXML'
import testXML
Here is the repo with both framework and app projects.
I'm using both Xcode version on the same Mac.
Your project runs fine on my Xcode 11.3 tvOS simulator. However there's something I've noticed.
The framework you built only contains x86_64 architectures (simulator only), it won't work on physical devices.
For Xcode before 11.3 it seems like you need to add $(SDKROOT)/usr/include/libxml2 and ${SRCROOT}/libxml2 to Build Settings. That fixed the issue for me on Xcode 11.2.1

SenTestingKit Not found In Xcode4

When I tried to import <SenTestingKit/SenTestingKit.h>, I get this error: SenTestingKit/SenTestingKit.h: No such file or directory.
I am using unit testing for the first. I am using xcode 4.2 with ios 5 sdk. But in my system I have two xcode version installed,4.2 and 3.2.5. Although i am using xcode 4.2 ,xcode3.2.5 is the default xcode in my system. Can any one help me with the unit testing?
SenTestingKit.framework is at :
/Developer/Library/Frameworks/SenTestingKit.framework (OS X)
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOSX.X.sdk/Developer/Library/Frameworks/SenTestingKit.framework (iOS)
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulatorX.X.sdk/Developer/Library/Frameworks/SenTestingKit.framework (simulator)
for Xcode versions 4.3 and above prepend /Applications/Xcode.app/Contents/ to the paths above
I don't know, but the frameworks path will be different for both xcodes. it might be in 3.2.5 frameworks path and when using 4.2, it may not find it. Correct me if I'm wrong.

How to use Cocos 2D 1.1.0, When I run a sample Cocos2D Appication it gives error

How to use Cocos2D 1.1.0, When I am choose a template as Cocos2D Application and name it "NewCocos", When simply run this project without doing anything It gives me
124 errors
of same type = error: missing binary operator before token "("
this errors shows near "#if defined(__has_feature) && __has_feature(objc_arc)"
18 Warnings
of same type = warning: ignoring #pragma clang diagnostic
this warning shows near "#pragma clang diagnostic push" , "#pragma clang diagnostic pop" etc...
I am using XCode 3.2.4 and iOS / iPhone OS 4.1
In short statement gives (124 times) error of
error: missing binary operator before token "("
on the statement without quotes "#if defined(__has_feature) && __has_feature(objc_arc)"
This is working fine in Cocos v1.0.1 older version but not working on cocos v1.1.0
Cocos2D v1.1 requires to set the compiler to "Apple LLVM compiler" in Build Settings. Only Xcode 4.0 and newer are shipped with the Apple LLVM compiler. Furthermore, to enable ARC you must be using at least Xcode 4.2 with the "Apple LLVM compiler 3.0".
You should seriously consider upgrading. Xcode 3.2 is over 2 years old now (released: August 2009). As mentioned here, only apps built with the latest, or if not "too old" the second to latest iOS SDK version are going to be approved by Apple (at the time of this writing iOS 5.0 is the latest SDK but iOS 4.3 apps are also still accepted). Regardless of that, Xcode 4 makes it a lot easier to submit apps through its built-in Organizer.
this is XCode 3.2.4 problem Update Your X-Code Minimum X-Code 4.2.0

Missing stack trace in Xcode debugger when exception is thrown on both iOS simulator and device

When my app throws an exception it prints the following in the debugger output:
First throw call stack:
(0x310f88bf 0x3829d1e5 0x31e76015 0x31e7640d 0x31e764c5 0x9e903 0x9edfb 0x32b15d55 0x32b20e8d 0x310cb2dd 0x3104e4dd 0x3104e3a5 0x33c7cfed 0x330c0743 0x3267 0x3220)
Software stack:
Xcode 4.2 in Lion 10.7.2 (Xcode 4.1 is not installed)
I am leaning towards this this being an Xcode bug, but do you see anything obvious that I missed?
What I have tried / checked
Build Settings:
Debug
Strip Debug Symbols During Copy = NO
Strip Linked Product = NO
Optimization Level = -O0 and-Os
Symbols Hidden By Default = YES and NO
Compiler = LLVM 3.0 and LLVM GCC 4.2
Scheme:
Debugger = GDB and LLDB
Cleaning:
Clean
Clean Build Folder
Delete Derived Data Directory (remove from organizer)
Devices:
iOS 5 Simulator
iOS 5 iPhone 4
iOS 5 iPhone 3Gs
Random:
I originally had this problem with both Xcode 4.1 and 4.2 installed, so uninstalled both and reinstalled just 4.2
Tried with different projects with the same results.
When fiddling with breakpoints I see this in the debugger output before the exception:
Catchpoint 36 (throw)Catchpoint 37 (catch)Pending breakpoint 2 - "__cxa_begin_catch" resolved
warning: Attempting to create USE_BLOCK_IN_FRAME variable with block that isn't in the frame.
warning: Attempting to create USE_BLOCK_IN_FRAME variable with block that isn't in the frame.
Catchpoint 36 (exception thrown).warning: Attempting to create USE_BLOCK_IN_FRAME variable with block that isn't in the frame.
warning: Attempting to create USE_BLOCK_IN_FRAME variable with block that isn't in the frame.
Ok, found the issue: Well not me but Joe (a phillyCocoa member)… But since he is not on SO, I will post his solution.
The deployment target was set to 4.0, but since the 4.0 debug symbols must be downloaded separately in Xcode 4.2, the DSYM wasn't valid.
2 ways to fix:
1. Install the debug symbols for 4.0 from the Xcode preferences.
2. Set the deployment target to 4.3 or higher.
The only thing that sticks out is that development builds should probably have optimisation switched off altogether with -O0.