i am wondering that if it is possible to set the delegate of input stream to another class. So far all examples i have encountered are with self:
[inputStream setDelegate:self].
I want to set delegate to another class like a ViewController not self. Thanks in advance.
iOS - Setting delegate of input stream to another class
1.8k Views Asked by M. Salih Kocak At
2
There are 2 best solutions below
Related Questions in IOS
- Overlapping UICollectionView in storyboard
- Cannot pod spec lint because of undeclared type errors
- Is the transactionReceipt data present in dataWithContentsOfURL?
- UIWebView Screen Fitting Issue
- ZXingObjC encoding issues
- iOS: None of the valid provisioning profiles allowed the specific entitlements
- How to hide "Now playing url" in control center
- CloudKit: Preventing Duplicate Records
- Slow performance on ipad erasing image
- Swift code with multiple NSDateFormatter - optimization
- iOS 8.3 Safari crashes on input type=file
- TTTTimeIntervalFormatter always returns strings in English
- How do I add multiple in app purchases in Swift Spritekit?
- Setup code for xibs in iOS. -awakFromNb:
- iOS Voice Over only reads out the title of any alert views
Related Questions in DELEGATES
- Pass Data between two view controllers using 'Delegation' : Objective-C
- Akka actor invoked with a function delegate - is this bad practice?
- Declare conditional delegate methods in iOS
- JQuery not working after using append()
- Delegates in Navigation Controller
- swift custom UIAlertViewDelegate not work
- IBOutlet nil after closing NSWindow sheet - swift
- Delegate returning nil - Swift
- Implementing delegate methods in separate class
- swift: select dynamic table cell and either push or pop view controller depending on stack
- ios-Facebook login delegate method isn't working
- Xcode, have delegate method auto-include classes
- Subclass as delegate of superclass
- specify type of delegate parameter
- Delegate with generic list signature for passing data to another form
Related Questions in INPUTSTREAM
- Java Socket - how does the read() method know if the end of stream has been reached?
- What is meant by Streams w.r.t Java IO
- Read file from local PC from network deployed app to InputStream
- PDFBox: extracting images from pdf to inputstream
- InputStream vs Reader
- Reading content from a URL failing
- InputStream appears to be loading twice
- skip method in CipherInputStream
- How to send ZipInputStream as attachment via java mail?
- Reading Microsoft Word in order read
- Parse InputStream "on the fly" / re-use an InputStream
- audio reading in jar executable file
- How to download and stream audio in Android?
- Trying to use getResourceAsStream() and failing
- Cannot get an image from inputStream
Related Questions in NSINPUTSTREAM
- How to convert NSInputStream to NSString or how to read NSInputStream
- How to convert NSStream (NSInputStream / NSOutputStream) to SSL after stream opened?
- What's the best way to consume the bytes of NSData?
- I cannot initialize a NSInputStream
- How to create a NSInputStream/NSOutputStream pair by accepting a server socket?
- iOS - Setting delegate of input stream to another class
- Does -[NSInputStream read:maxLength:] block?
- NSStreamDelegate not receiving messages
- Scheduling stream on NSRunLoop
- Not getting more messages after receiving first message from Java server in iOS client using NSInputStream
- Using NSXMLParser initWithStream: no parser delegate methods received
- How to correctly measure NSInputStream data rate
- iOS7 comparison of constant with expression is always false
- Error deserializing json stream
- What Am I Missing? : iPhone Objective-C NSInputStream initWithData
Related Questions in CFREADSTREAM
- iOS - Setting delegate of input stream to another class
- get the file size of a CFHTTPStream
- Google Cloud Function returns undefined on bucket finalize buffer. Unable to debug code
- Get file size on FTP download
- Twitter Streaming API - Objective-C
- How to extract only the 1st 2 bytes of data from CFReadStream in Objective-C for iPhone programming
- Subclassing NSInputStream to upload a particular portion of data from a local filepath
- Handling errors in CFReadStream - Obj-C
- I want to stream a video using node js from an on prem video library, not a file system
- Keep alive UDP socket in background for ios
- VPN blocking incoming reads CFReadStreamRef iOS
- iPhone data transfer using CFReadStream & CFWriteStream (bonjour)
- Unable to write using CFWriteStream
- i386 symbols not found
- CFStream IOS Socket communication
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
if your
ViewControlleris responding toNSStreamDelegate, you can initiate an instance of the controller and set the delegate as usual.-
for example
update:
use an id or
UIViewController<NSStreamDelegate>variable in theTCPConnectionclass to hold the parent.For example:
...
Or a singlton solution, where you always call only
and have only one instance of this class. For the most cases the best way ;)