iOS 6 - BluetoothManager framework - "NSObject" not found error - iphone

My question is a duplicate of this one. But that one (rightly)got closed as non constructive, with zero answer and with absolutely no use to anyone.
I am trying to connect to a external bluetooth accessory from my iPhone 5. The accessory is neither MFI certified nor support Bluetooth Low energy communication.
So my only option is to connect to it using a private Framework, and I am doing that since I am not intending to push my app to App store. The app is for personal use.
I am trying to use private BluetoothManager framework class, uses XCode 4.6 and my app is targeting iOS 6.0.
My current setup
Added a folder named Headers in bluetoothManager framework in sdk
folder
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/PrivateFrameworks/BluetoothManager.framework
Created 4 header files in that folder, namely
BluetoothAudioJack.h
BluetoothManager.h
BluetoothDevice.h
CTStructures.h
I got these header files from here.
Added BluetoothManager.framework to my project , using normal method
target->Build Phases->Link Binary with Libraries .
In my ViewController.h file, I imported the header file
#import "BluetoothManager.h"
This is it. Simply I am following this tutorial, but added the steps here just in case the tutorial went down.
My problem
I am yet to get into the coding part. When I tried to compile the above given setup, I am getting error
NSObject.h file not found
in the BluetoothManager.h file I added as header to the framework.
Any ideas?

Well I finally solved this problem. I just removed those
#import "NSObject.h"
calls from 3 header files which I mentioned in the question, and Voila!!

Related

How Do I ' #import "Firebase.h ' in Xcode?

I'm manually adding some Firebase SDK's in my iOS app and have been following Firebase's provided readme to the letter. As it directs, I've already dragged all the SDKs I need into my project but there's one step I'm not understanding. It reads:
8. Drag the Firebase.h header in this directory into your project. This will
allow you to #import "Firebase.h" and start using any Firebase SDKs that you
have.
I've added the Firebase.h header file into my project but I don't know how/where to add #import "Firebase.h". Since I haven't done that, building my app produces the error: No such module 'Firebase' when I try to import Firebase in my view controllers.
For reference, I had been using cocoapods for Firebase up until the recent iOS 13.3.1 update that broke my ability to test my app on my physical device, so I'm attempting to manually add the static Firebase SDK's in the hopes that I would then be able to continue debugging on my iPhone 6s. I'm 75% of the way through my app's development and have already fully integrated Firebase so this little switch-over from pods to static SDKs is definitely annoying, but it has to be done. I removed all the Firebase pods I was using in my Podfile and am just stuck at the step bolded above... hopefully it's a simple thing and then everything will work again as I already have it completely integrated throughout my app.
If you'd like a deeper background, here's a Stack Overflow question that describes the exact initial problem I was having with debugging on my physical device with the 13.3.1 iOS update.
And here's where I asked for alternative ways to incorporate Firebase that avoids pods (in case that fixes the issue). This is where I learned about Firebase's zip binary distribution. I downloaded the zip file with the Firebase SDKs, chose the ones I need, and have been following the readme to add them to my project.
To add Firebase module support, you also need to do the subsequent instruction in the zip distribution README after dragging Firebase.h:
9. If you're using Swift, or you want to use modules, drag module.modulemap into
your project and update your User Header Search Paths to contain the
directory that contains your module map.

How to remove some of the Swift libraries copied by Xcode?

In Xcode 10, the "Copy Swift standard libraries" script is done last — after any custom build phases that may be added to the target. Hence it is not possible to create a custom build script to specifically remove Swift standard dylib files added by Xcode.
The question is, how to remove some of these standard libraries that are erroneously added by Xcode?
The reason behind it is that when Xcode 10 builds a Swift 4.2 macOS app that has a Photo Editing extension, it adds libswiftMapKit.dylib into the application bundle — even when the application does not have Maps functionality or import MapKit. This caused an App Review rejection.
To remove a Swift Standard Library, add a Post-Actions in the scheme. Most likely this would be an Archive post-action since archiving is typical prior to a release (upload to App Store or to re-sign using a Developer ID credential).
In Xcode 10 Click Edit Scheme.
In the scheme editing, expand the Archive section.
Click on Post-Actions
Enter the following bash script fragment (along with any other post-actions that you may already have)
# This variable points to the `Frameworks` folder of the final application.
full_frameworks_path="${ARCHIVE_PRODUCTS_PATH}/Applications/${FRAMEWORKS_FOLDER_PATH}"
# Specify the libraries to remove, the example below removes Swift's MapKit wrapper.
rm -f "${full_frameworks_path}/libswiftMapKit.dylib
However note that this does not solve the underlying problem of the Photos App Extension actually links to libswiftMapKit.dylib — a dependency added by Xcode 10.0 regardless whether it really uses MapKit or not.

iPhone: How to use Tesseract

This is regarding use of Tesseract in an iPhone app. I followed the steps provided here:
http://iphone.olipion.com/cross-compilation/tesseract-ocr
Now I have 2 questions:
1) How to use this in my iPhone project (which files need to be included, methods need to be called, etc.)
2) I googled and found that I'll have to include libtesseract_api.a
but got this message:
file was built for unsupported file format which is not the architecture being linked (i386)
Please help me to understand this.
I guess you have tried to run the app in Simulator, which will support i386 architecture.
Please follow this link to make the static library.
Start here:
http://tinsuke.wordpress.com/2011/02/17/how-to-cross-compiling-libraries-for-ios-armv6armv7i386/
and then follow this updated guide:
http://tinsuke.wordpress.com/2011/11/01/how-to-compile-and-use-tesseract-3-01-on-ios-sdk-5/
It will help you cross compile and build a universal library that contains the arm6/arm7/i386 all in the one statically linked library so it should work on simulator and device and be suitable for AppStore distribution.
Also if you have XCode 4.3 or higher beware and read the comments about how the developer directory has changed.

Building the Objective-C XML-RPC Framework for iOS

I'm fairly new to the iOS SDK and Xcode and I stumbled across this XML-RPC framework https://github.com/eczarny/xmlrpc that I'd really like to use in one of my projects. I downloaded the sources, the initial target was set to Mac OS, so I changed that to iOS 4.3 but got the following dependency error:
target specifies product type 'com.apple.product-type.framework', but there's no such product type for the 'iphoneos' platform
So I removed all the targets and added a new one from scratch using the Cocoa Touch Static Library, and it seems like it's been built just fine. Now my question is whether this is the correct way to build that library for iOS development, and where do I take it from here? I can't find the .framework directory anywhere (the install dir was set to "#executable_path/../Frameworks") so I can't embed it in my iOS project. How exactly does this go? Thanks!
Thanks for your help and sorry if this is too "newbish". Cheers!
If you're using Xcode 4.x open the Organizer, select the Projects tab and then down the left hand side you should see an entry relating to the XML-RPC project. Select that and under the Derived Data heading you'll see a path which if you follow using finder should lead you to the folder containing the static library you've built.

non lazy ptr linking error - the solution

I have received many errors while trying to Build & Run my iphone app using the xcode.
All the errors stated "non lazy ptr" for the used variables in the code.
The solution for me (and for all of you) is to look for the correct framework to be used according to the Simulator and Device versions the code will be running on.
At first i have chosen the AVFoundation framework from the iphone os 2.2 folder. and when i removed that and choose the framework from the iphone os 3.0 folder - the linking errors where gone and the code run perfectly.
so, in short the solution is to change the framework source folder.
Hope that helps :)
Frameworks should automatically be taken from the Active SDK, so resetting them shouldn't be necessary. We've seen some projects that have somehow gotten hardcoded SDK paths into their Framework Search Paths build settings; that is often the cause of this problem (and your fix simply hardcodes a more-recent path for an invalid one, which kicks the can down the road a ways but will break again in the next SDK bump.) The real solution is to look at your target's Framework Search Paths and delete any SDK-specific paths you find.