Failed to load espeak-data xcode 6 with ios 8 - ios

I am using espeakEngine project in my project all was running fine before xcode 6 and ios 8.
when i install xcode 6 beta 2 and run my app with iphone4s and other sumulator i am getting this error
Can't read data file: '/Users/sandeepsharma/Library/Developer/CoreSimulator/Devices/D05D7879-FB45-4E0C-B03A-0AB4202E1608/data/Applications/6B68F910-5822-47E5-B645-99BF4F8DE/phontab'
Failed to load espeak-data
I am surprise the path with this line
NSString * path = [[NSBundle mainBundle] bundlePath];
this line give with xcode 5.0 with ios 7 "/Users/sandeepsharma/Library/Application
Support/iPhone Simulator/7.0.3-64/Applications/66286A80-A5C7-4FB7-BEC7-E43C716017DD/TestApp.app"
and With xcode 6 with ios8
"/Users/sandeepsharma/Library/Developer/CoreSimulator/Devices/D05D7879-FB45-4E0C-B03A-0AB4202E1608/data/Applications/6B68F910-5822-47E5-B645-99BF4F8DEC94/TestApp.app"
Please help me i am stucking on this i this this the only path problem with ios 8.

I realize this is an old question but I'm posting the answer in case others run into it, as I did. I wasn't able to find an answer anywhere.
The cause of this problem in Xcode 6 with iOS 8 can be found on or near line 75 in the espeak_1.0/Libraries/speech.h file. Xcode 6's simulator application path turns out to be longer than the size defined. The fastest fix is to change
#ifdef PLATFORM_WINDOWS
#define N_PATH_HOME 220
#else
#define N_PATH_HOME 150
#endif
to this:
#ifdef PLATFORM_WINDOWS
#define N_PATH_HOME 220
#else
#define N_PATH_HOME 220
#endif
Or, better yet, get rid of the conditional and keep only one line:
#define N_PATH_HOME 220
The path was being truncated when 150 was the size. Change it to 220 and it works (at least with my directory structure and resulting paths).

Related

Using LC_ENCRYPTION_INFO for basic crack detection on 64bit systems?

I was using LC_ENCRYPTION_INFO to check if binary is encrypted/compressed or not. I was using this to guess the possibility of the app being a pirated copy.
On ARM64 devices I see that this no longer works and I started to get false positives. Do you have any experience on this one? What could have been changed in ARM64? (it works on iPhone 5 iOs 9beta, but not on iPhone 5s and 6 8.4)
please refer to this answer:
https://stackoverflow.com/a/22292104/1754559
This code won't work successfully on a 64-bit device like the iPhone 5s. The header has been changed from mach_header to mach_header_64 and the command ID is now LC_ENCRYPTION_INFO_64.
What I did was to read the header and then see what the magic number
was. If it's MH_MAGIC_64 then you're on a 64-bit device and you need
to use the mach_header_64 struct and look for LC_ENCRYPTION_INFO_64
(defined as 0x2C) instead of LC_ENCRYPTION_INFO.
to check if you are on a 32 bit or 64 bit you can get the size of a pointer. if it is 4 you are on a 32 bit device else it will be 8

Can not find <coreaudiokit/coreaudiokit.h> in ios8 xcode6

I am trying to get the MIDI over BLE working as discussed at session 501 at the WWDC 2014.
I get an error "file not found" when trying to #import CoreAudioKit/CoreAudioKit.h framework
I have included the framework in the build menu and tried putting the #import line in the .h or .m ViewController file.
It recognizes and compiles CoreBluetooth/CoreBluetooth.h with no problems.
This is a brand new installation of Xcode 6 downloaded yesterday (13 Sept 2014)
I feel like Apple has not turned on the switch for CoreAudioKit for iOS.
Any guidance on what I am doing wrong would be most gratefully received.
Thank you,
Ken
CoreAudioKit is not compatible with the iOS Simulator. Run it on a device, and it should build just fine
I you want to use the simulator for some other tests (not related to midi over bluetooth) you can use a conditional import of the framework:
#ifdef __APPLE__
#include "TargetConditionals.h"
#if TARGET_IPHONE_SIMULATOR
#compatibility_alias CABTMIDICentralViewController UIViewController;
#elif TARGET_OS_IPHONE
#import <CoreAudioKit/CoreAudioKit.h>
#endif
#endif
You still have to do optional linking of the framework in your build settings since CireAudioKit is not available at all on the simulator (OS X) platform.

Xcode 6 GM version, iPhone 6 simulator, no visible #interface for 'UITapGestureRecognizer' declares the selector 'initWithTarget:action:'

UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:#selector(panGestureRecognized:)];
This code can compile for any simulator in Xcode 5,
but in Xcode 6, it can only compile for simulators with 32 bit CPUs(iPhone 5 and under),
when compiling for simulators with 64 bit CPUs(iPhone 5s, iPhone 6, iPhone plus), compiler says:
no visible #interface for 'UITapGestureRecognizer' declares the
selector 'initWithTarget:action:'
But I do have imported <UIKit/UITapGestureRecognizer>
What's the problem?
Try Product > Clean menu first.(i.e. command + shift + k)
If it won't help, with option key, Product > Clean Build Folder... (i.e. option + command + shift + k).
At last, remove all derived data directory with rm -rf ~/Library/Developer/Xcode/DerivedData/.
I think ~/Library/Developer/Xcode/DerivedData/ModuleCache/* made with old (Xcode5) SDK causes this problem.
For me this started happenning when I updated to xCode GM, and only when 5s, 6, 6+ simulator is selected. All others are fine.
Removing ~/Library/Developer/Xcode/DerivedData/ModuleCache solved it for me
I removed my Xcode 5 bundle and restarted my Mac, then magically it works now, I still don't know the reason however.
None of the above cache cleaning tricks helped. But when I changed the deployment target to less than iOS 8.1 the error went away.

#ifdef to detect arm64 build at compile time on iOS [duplicate]

I am trying to build an iOS Application for 64 bit. How do I know weather it is build for 32 bit or 64 bit ?
Does Mach-O-View can help ? if Yes, where to look for it ?
Also is there any command line for it. ?
I reffered this but it does not help me to know weather this it is built or not for 64 bit.
https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html#//apple_ref/doc/uid/TP40013501-CH3-SW1
Try this:
#ifdef __LP64__
// NSLog(#"64");
#else
// NSLog(#"32");
#endif
It works for OS X, but I didn't test it for iOS (I don't have an iPhone5S :( ).
Edit:
By the way, it works fine on iPhone Simulator.

Conditionally Hide Code from the Compiler

So here's the problem. I'm set to release an update soon for iOS that will address some problems in iOS 7. In order to do this, I need to use some specific iOS 7 functions/types. I've made absolutely certain that iOS 7 code will only be executed on iOS 7 and fallback to different code for pre iOS 7. Of course, I'm not allowed to submit with the current Xcode beta, so I'm trying to compile with the current Xcode release. However, I can't seem to find a way to disable this particular warning:
Use of undeclared identifier '<Redacted>'.
Does anyone know of a way to disable this warning using a #pragma. I've tried a bunch of different ones including
-w, -Weverthing, -Wall
but nothing seems to work.
UPDATE
Answer: You can't, of course, because the compiler can't compile an identifier it knows nothing about. My solutions was to simply create a #define:
#define <redacted> 1
UPDATE 2
The answer below actually made it much easier. I had already created a #define Xcode5Code(code, alt) that allowed me to execute code blocks conditionally. By modifying it using the solution by #maddy:
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
#define Xcode5Code(code, alt) code
#else
#define Xcode5Code(code, alt) alt
#endif
This allows me to to easily hide blocks of code from the compiler by using:
Xcode5Code({
//Code to be execute only with Xcode 5
}, {
//code to be executed in previous versions of Xcode
})
The main benefit of using the #define Xcode5Code is that Xcode will auto-complete it for you, which is a lot easier than using the full #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000, which Xcode won't auto-complete.
This won't actually distinguish between iOS 7 and pre iOS 7 devices. It only distinguishes what version of iOS the current Xcode can handle. To distinguish between iOS devices versions I use:
NSUInteger DeviceSystemMajorVersion(void) {
static NSUInteger _deviceSystemMajorVersion = -1;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_deviceSystemMajorVersion = [[[[[UIDevice currentDevice] systemVersion] componentsSeparatedByString:#"."] objectAtIndex:0] intValue];
});
return _deviceSystemMajorVersion;
}
The above is Apple's code, by the way. To dance around the NDA a little, I'll say that this helps with laying out a root controller's view, because that depends on both the version of Xcode you're using AND the version of iOS that's on the device. And if you're trying to manage beta's as well as production code, this can help a lot. Once you can submit apps with Xcode 5, the #define Xcode5Code will no longer be necessary.
If you want to compile your app with two difference versions of Xcode or two different Base SDK settings then you should use compiler directives:
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 // iOS 7.0 supported
// iOS 7 code here
#else
// Pre-iOS 7 code here
#endif
Do not use this for runtime checks. This solution is only to be used when you must compile your code with two different versions. An example would be you have added iOS 7 code but you still need to compile the code with Xcode 4.6. Using the compile directives allows you to "hide" the iOS 7 code from the compiler using the older Base SDK.
See the "SDK Compatibility Guide" in the docs for more on this and proper runtime checks.

Resources