swift - Failed to recognize AWSDynamoDB with XCode 7.0 Beta, iOS 8.3, and aws-ios-sdk-2.2.0 -
i matching guides using awsdynamodb in test project using swift 2 in xcode 7.0 beta. required use platform instead of previous stable 1 , make work.
i using next links:
https://docs.aws.amazon.com/mobile/sdkforios/developerguide/setup.html
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/loaddata_java.html
best way make amazon aws dynamodb queries using swift?
i made work reading , writing text files , images s3 bucket, trying use dynamodb service might missing.
here podfile contents:
# uncomment line define global platform project platform :ios, '8.3' target 'awssdktest' source 'https://github.com/cocoapods/specs.git' pod 'awscore' pod 'awsautoscaling' pod 'awscloudwatch' pod 'awsdynamodb' pod 'awsec2' pod 'awselasticloadbalancing' pod 'awskinesis' pod 'awslambda' pod 'awsmachinelearning' pod 'awsmobileanalytics' pod 'awss3' pod 'awsses' pod 'awssimpledb' pod 'awssns' pod 'awssqs' pod 'awscognito' end target 'awssdktesttests' end
i had delete podfile.lock , pods folder, deleted configuration sets in project->info->configurations, , installed pods again. here bridging.h file:
#ifndef awssdktest_bridging_h #define awssdktest_bridging_h #endif #import <awscore/awscore.h> #import <awss3/awss3.h> #import <awsdynamodb/awsdynamodb.h> #import <awssqs/awssqs.h> #import <awssns/awssns.h> #import <awscognito/awscognito.h>
i downloaded aws-ios-sdk-2.2.0.zip file, unzipped , added frameworks aws frameworks.
i trying use awsdynamodbmodel, here swift file implementing upload sample items example using dynamodb mapper:
import foundation class forum : awsdynamodbmodel, awsdynamodbmodeling { var name : string = "" var category : string = "" var threads : int = 0 var messages : int = 0 var views : int = 0 // override init!() { super.init() } required init!(coder: nscoder!) { fatalerror("init(coder:) has not been implemented") } class func dynamodbtablename() -> string! { return "demo" } class func hashkeyattribute() -> string! { return "email" } class func rangekeyattribute() -> string! { return "date" } /* override init(dictionary dictionaryvalue: [nsobject : anyobject]!, error: nserrorpointer) { super.init(dictionary: dictionaryvalue, error: error) } override func isequal(anobject: anyobject?) -> bool { return super.isequal(anobject) } */ }
i had comment lines caused error because might fixed. errors mentioned functions couldnt overridden , super.init couldnt called inside root method.
after cleaning , building again, error @ class declaration line
class forum : awsdynamodbmodel, awsdynamodbmodeling {
the error says: use of undeclared type 'awsdynamodbmodel' if try writing other awsdynamodb classes don't appear in list of suggestions , cause same error.
additionally want mention in developer's guide setup (first link above) 4th point of getting started swift section says: "import awscore header in application delegate":
#import <awscore/awscore.h>
than can't done, in bridging.h file mentioned in 2nd point.
my first request of assistance in fixing error mentioned , making project recognize awsdynamodb framework. request observation merge of different tutorials, other online tutorial or guide more clear mentioned.
in case using cocoapods (0.36) "use_frameworks!", answer might solve problem:
"normally when you’re importing objective-c code swift, including header of file containing code in “bridging header” project. , indeed how include code static library (which pods used be.)
but not how import objective-c code framework. type…
import framework
…inside swift file that’s using objective-c class (where “framework” name of actual framework containing class.)"
source here: http://rogueleaderr.com/post/115372471213/unresolved-identifier-in-swift-when-importing
Comments
Post a Comment