Comments (10)
Hi, one question, are you using a framework to hold your data models? If so, then you should initialise it by calling a function like:
EVReflection.setBundleIdentifier(Forecast)
P.S. You could also add multiple frameworks
from alamofirejsontoobjects.
I created a completely new project and moved my files to that one. Same settings and it worked. Sorry for the late answer.
from alamofirejsontoobjects.
Hi. I just use EVReflection and AlamofireJsonToObjects. Do I have to do this?
from alamofirejsontoobjects.
Hi again. I'm testing your test class and I'm getting error in that.
I imported Alamofire,EVReflection and AlamofireJsonToObjects pods in TestClass.
And My pod file like this,
platform :ios, '9.0'
use_frameworks!
target 'ProjectA' do
pod 'Alamofire', '3.5.0'
pod 'AlamofireJsonToObjects'
pod 'EVReflection'
pod 'ObjectMapper', '1.4.0'
pod 'SwiftEventBus'
pod 'AlamofireObjectMapper', '3.0.2'
pod 'Kingfisher', '> 1.8'> 0.1.3'
pod 'Player', '
pod 'SCLAlertView'
pod 'MBProgressHUD'
pod 'Fabric'
pod 'TwitterKit'
pod 'TwitterCore'
pod 'MobilePlayer'
pod 'PureLayout'
pod 'SwiftyJSON', '~> 2.0'
pod 'SwiftKeychainWrapper'
pod 'KeyClip'
end
target 'ProjectATests' do
pod 'Alamofire', '3.5.0'
pod 'AlamofireJsonToObjects'
pod 'EVReflection'
pod 'ObjectMapper', '1.4.0'
pod 'SwiftEventBus'
pod 'AlamofireObjectMapper', '3.0.2'
pod 'Kingfisher', '> 1.8'> 0.1.3'
pod 'Player', '
pod 'SCLAlertView'
pod 'MBProgressHUD'
pod 'Fabric'
pod 'TwitterKit'
pod 'TwitterCore'
pod 'MobilePlayer'
pod 'PureLayout'
pod 'SwiftyJSON', '~> 2.0'
pod 'SwiftKeychainWrapper'
pod 'KeyClip'
end
`
and versions
Using Alamofire (3.5.0)
Using AlamofireJsonToObjects (1.6.0)
Using AlamofireObjectMapper (3.0.2)
Using EVReflection (2.46.0)
Using Fabric (1.6.8)
Using KeyClip (1.3.3)
Using Kingfisher (1.9.3)
Using MBProgressHUD (1.0.0)
Using MobilePlayer (1.1.5)
Using ObjectMapper (1.4.0)
Using Player (0.1.3)
Using PureLayout (3.0.2)
Using SCLAlertView (0.6.0)
Using SwiftEventBus (1.1.0)
Using SwiftKeychainWrapper (2.0.0)
Using SwiftyJSON (2.4.0)
Using TwitterCore (2.4.0)
Using TwitterKit (2.4.0)
And now I'm getting following error in Evreflection. I couldn't solved this problem. Please help me.
from alamofirejsontoobjects.
The most common cause of this error is one of these:
- array of nullable objects
- using generic object in an array
There is a workaround available for that. You have to implement the EVArrayConvertable protocol. This means that you have to implement the function:
func convertArray(_ key: String, array: Any) -> NSArray
For a sample see:
https://github.com/evermeer/EVReflection/blob/Swift3/EVReflection/EVReflectionTests/EVReflectionWorkaroundsTests.swift#L180
If it's not this, then I need more information for solving this. Usually the class structures plus a json will be enough.
from alamofirejsontoobjects.
First of all, I really thank you for your interest and quick answers.
Secondly now I am just using your test class, models and json but I'm getting this error.
from alamofirejsontoobjects.
That's strange... Then that could only happen when there is a bundle identifier mis match. Usually this could be corrected by using:
EVReflection.setBundleIdentifier(YourClassHere)
I do use code for fixing bundle identifier names with special characters. Maybe you are using unhandled special characters. What do you get if you print this:
print(Bundle(for: type(of: YourClassHere())).infoDictionary?[kCFBundleNameKey as String] as? String ?? "")
print(Bundle(for: type(of: YourClassHere())).bundleIdentifier)
from alamofirejsontoobjects.
Hey. I changed versions and remove some pods . As a result I solved my problem in Unit Test class.
But in ViewController class I'm still getting "Could not create an instance for type Forecast" error.
In ViewController class I added "EVReflection.setBundleIdentifier(Forecast)" before request call but nothing is changed. This is same error I got when I removed EVReflection.setBundleIdentifier(Forecast) from unit test.
from alamofirejsontoobjects.
are you sure that the name of your bundle does not have any special characters?
what is the CFBundleName in your .plist? Is it set to $(PRODUCT_NAME) ?
What do you have in your targets display name?
from alamofirejsontoobjects.
Is this still an issue?
from alamofirejsontoobjects.
Related Issues (20)
- Nested Generics HOT 1
- Swift 3 and Alamofire 4 HOT 3
- get Array with key HOT 3
- Migration help needed HOT 9
- [Question] What happens if the response is not of expected type? HOT 5
- Swift 2.3 and Alamofire 3.5 support? HOT 3
- 1.6 version uses EVReflection swift 3 version HOT 2
- .description outputs a boolean as a number (0 or 1) HOT 3
- Mapping list of objects? HOT 2
- Use legacy swift error with swift 3 HOT 4
- Incorrect arguments label in call HOT 12
- Is not key value coding-compliant for the key __response_statusCode? HOT 10
- Error parsing array swift 3 HOT 2
- Array mapping return empty array HOT 13
- Help with usage HOT 2
- Build error when including as CocoaPod HOT 4
- Swift Compiler Error for Xcode 8.3 HOT 7
- Problems after updating the pod and to Swift4 HOT 1
- Compiling for iOS 8.0, but module 'Alamofire' has a minimum deployment target of iOS 10.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alamofirejsontoobjects.