Comments (16)
Sorry,the document has not been updated, now you do not need to create CocoaMQTT-Bridging-Header.h
from cocoamqtt.
CocoaPods , Carthage and Manual should done step by step?
I follow CocaPods and Manual, the project will compile failed for "import CocoaAsyncSocket --- no such moudle ’CocoaAsyncSocket ‘
from cocoamqtt.
Does not need select all, just select one: CocoaPods Carthage or Manual
from cocoamqtt.
@lsxredrain ,you can recreate a project, just use CocoaPods.
from cocoamqtt.
follow those step:
$ git init
$cd CocacaMQTT
$vi Podfile
$cat Podfileplatform :ios, 9.0
use_frameworks!
pod 'CocoaAsyncSocket'
pod 'MSWeakTimer'
pod 'CocoaMQTT'
$pod install
open CocoaMQTT.xcodeproj
then compile this project in Xcode, it will find three compile error/Users/lsx/workbase/CocoaMQTT/Source/CocoaMQTT.swift:364:27: Expected expression in list
of expressions
/Users/lsx/workbase/CocoaMQTT/Source/CocoaMQTT.swift:364:27: Expected ',' separator/Users/lsx/workbase/CocoaMQTT/Source/CocoaMQTT.swift:10:8: No such module 'CocoaAsyncSocket'
from cocoamqtt.
just two step:
1.create the Podfile with follow content:
use_frameworks!
pod 'CocoaMQTT'
2.excude the command:
pod install
from cocoamqtt.
lsxdeMacBook-Pro:CocaMQTT lsx$ cat Podfile
use_frameworks!
pod 'CocoaMQTT'
lsxdeMacBook-Pro:CocaMQTT lsx$ pod install
CocoaPods 1.0.0.beta.8 is available.
To update use: gem install cocoapods --pre
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Analyzing dependencies
[!] Could not automatically select an Xcode project. Specify one in your Podfile like so:
xcodeproj 'path/to/Project.xcodeproj'
lsxdeMacBook-Pro:CocaMQTT lsx$ ls
Podfile Pods
from cocoamqtt.
Make sure you are running $pod install from your project directory:
from cocoamqtt.
lsxdeMacBook-Pro:CocaMQTT lsx$ pwd
/Users/lsx/workbase/CocaMQTT
lsxdeMacBook-Pro:CocaMQTT lsx$ ls
Podfile
lsxdeMacBook-Pro:CocaMQTT lsx$ cat Podfile
platform :ios, 9.0
use_frameworks!
pod 'CocoaMQTT'lsxdeMacBook-Pro:CocaMQTT lsx$ pod install
Updating local specs repositories
CocoaPods 1.0.0.beta.8 is available.
To update use: gem install cocoapods --pre
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Analyzing dependencies
[!] Could not automatically select an Xcode project. Specify one in your Podfile like so:
xcodeproj 'path/to/Project.xcodeproj'
from cocoamqtt.
- first, you should create an xcode project
- create a Podfile in the project folder
- excute command
pod install
like my test project:
➜ swifttest ls
Podfile Pods swifttest.xcodeproj
Podfile.lock swifttest swifttest.xcworkspace
➜ swifttest
from cocoamqtt.
1 create null project as named CocoaHello in Xcode 7.2
2 create Podfile
3 pod install
localhost:CocoaHello lsx$ ls
CocoaHello Podfile uncrustify.cfg
CocoaHello.xcodeproj Podfile.lock
CocoaHello.xcworkspace Pods
localhost:CocoaHello lsx$ cat Podfile
platform :ios, '9.0'
use_frameworks! # Add this if you are targeting iOS 8+ or using Swift
pod 'CocoaMQTT'localhost:CocoaHello lsx$ ls Pods/
CocoaAsyncSocket Local Podspecs Pods.xcodeproj
CocoaMQTT MSWeakTimer Target Support Files
Headers Manifest.lock
4 close CocoaHello.xcodeproj
5 open CocoaHello.xcworkspace ------ not CocoaHello.xcodeproj
still have error
/Users/lsx/github/podtest/Pods/CocoaMQTT/Source/CocoaMQTT.swift:364:27: Expected expression in list of expressions
/Users/lsx/github/podtest/Pods/CocoaMQTT/Source/CocoaMQTT.swift:364:27: Expected ',' separator
/Users/lsx/github/podtest/Pods/CocoaMQTT/Source/CocoaMQTT.swift:361:68: Missing argument for parameter 'selector' in call
from cocoamqtt.
//CocoaMQTTReader Delegate
public func didReceiveConnAck(reader: CocoaMQTTReader, connack: UInt8) {
connState = CocoaMQTTConnState.CONNECTED
#if DEBUG
NSLog("CocoaMQTT: CONNACK Received: \(connack)")
#endif
let ack = CocoaMQTTConnAck(rawValue: connack)!
delegate?.mqtt(self, didConnectAck: ack)
//keep alive
//begin commit by lsxredrain 2016-4-21,then will compile sucessed
if ack == CocoaMQTTConnAck.ACCEPT && keepAlive > 0 {
// aliveTimer = MSWeakTimer.scheduledTimerWithTimeInterval(ß
// NSTimeInterval(keepAlive),
// target: self,
// selector: #selector(CocoaMQTT._aliveTimerFired),
// userInfo: nil,
// repeats: true,
// dispatchQueue: dispatch_get_main_queue())
}
//end
}
from cocoamqtt.
use the xcode7.3
from cocoamqtt.
i can't use Xcode 7.3 for my os is 10.10, can u add selector: #selector(CocoaMQTT._aliveTimerFired) for Xcode 7.2?
from cocoamqtt.
you can change selector: #selector(CocoaMQTT._aliveTimerFired)
to selector: "_aliveTimerFired",
from cocoamqtt.
ok thanks a lot!
as a newcomer of swift, I should study this article first
http://blog.csdn.net/eqera/article/details/39312125
from cocoamqtt.
Related Issues (20)
- When recovering session, frame (FramePublish) topic is empty HOT 4
- Not able to connect hivemq.cloud TLS/SSL port(8883). HOT 4
- Failed to connect to 8883 HOT 3
- Could not connect to MQTT 5.0 HOT 1
- How to get this to work on Xcode 15 HOT 3
- QOS 2 can deliver a message twice
- provide working example
- Privacy Manifest HOT 9
- publish message with 15MB of image Base64String failed. HOT 1
- TLS Support with Trusted Server Certificate HOT 5
- How can i set message expire interval?
- Retained message issue HOT 1
- "Index out of range" - error occurs when passing user properties to message
- Deployment target out of range HOT 4
- Priority Inversion Crash HOT 1
- CocoaMQTTWebSocket.swift:459:1 Type 'CocoaMQTTWebSocket.StarscreamConnection' does not conform to protocol 'WebSocketDelegate' HOT 4
- Connection issue
- Privacy Manifest HOT 3
- connecting at the same time with mqtt3 and mqtt5 to the same broker does not work HOT 2
- No userProperty info back to client in publish ack message. HOT 1
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 cocoamqtt.