Static library gives error on iOS simulator and works on iOS device
Currently I’m working on a iOS application (iOS 6), In which I need to implement a static library.
I successfully implemented the Static library using this tutorial. And I successfully added the static library to other project and Installed the app to iPhone !. It’s working successfully.
But my issue is when I tried to run it on my simulator some errors are coming:
"_OBJC_CLASS_$_MMPAlert", referenced from: objc-class-ref in ViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I added the target architecture like:
I searched a lot but couldn’t find a solution, why my library is working on device and giving error on simulator.
Please help me, thanks in advance
- iOS 5: Make NSString Category include NSCFConstantString?
- What is use of stretching property of UIImageView. How I can use this property.?
- Weird issue: UITableViewCell would not detect touch although it's accessory view does
- unsigned char in Swift
- IPv6 connection with DataSnap
- UISplitViewController Master / Detail communication
Solutions Collect From Internet About “Static library gives error on iOS simulator and works on iOS device”
You have propably built your library for the device architecture only. The iOS Simulator is not an emulator, meaning the code needs to be able to run on your Mac’s architecture, which is obviously different from your device’s architecture.
As a library is precompiled (for a specific architecture), the code it consists of doesn’t get compiled again for your current target once you use it in your project. This is why you need to build your library for both architectures in the first place.
This SO Answer explains how to bundle two library builds into one handy “fat file”.
- Formattting Phone number in Swift
- Keyboard handling just like in Messages app in iOS 7
- Swift: Get UITableView frame when initializing custom UITableViewCell
- Better “nothing function” in Swift?
- Implement Keyboard Key Pop Animation in iOS 8 Keyboard Extension
- How to disable/enable the sleep mode programmatically in iOS?
- Read static property from object
- Checking for equality in Objective-C
- How to unit-test NSFetchedResultsController in Swift
- Unrecognized selector sent to instance NSTimer Swift
- Why do I have to dismiss this UIAlertView three times?
- iPhone memory management (with specific examples/questions)
- IOS: UIScrollView with an infinite paging view
- Get list of all installed application in ios 8
- Make 2 contradictory methods work in drawRect