I'm attempting to incorporate this bit of code into a new(iOS 5) project... Problem is, I'm using ARC and it REALLY doesn't like the code as written.
I've been able to resolve most of the errors, but I'm stuck with 3 errors I can't seem to figure out.
Error #1:
Existing ivar 'delegate' for unsafe_unretained property 'delegate' must be _unsafe_unretained
.h
@interface SKPSMTPMessage : NSObject {
NSOutputStream *outputStream;
NSInputStream *inputStream;
id <SKPSMTPMessageDelegate> delegate;
}
@property(nonatomic, assign) id <SKPSMTPMessageDelegate> delegate;
.m
@synthesize login, pass, relayHost, relayPorts, subject, fromEmail, toEmail, parts, requiresAuth, inputString, wantsSecure, \
delegate, connectTimer, connectTimeout, watchdogTimer, validateSSLChain;
Errors #2 & #3:
Passing address of non-local object to _autoreleasing parameter for write-back
.h
@interface SKPSMTPMessage : NSObject {
NSOutputStream *outputStream;
NSInputStream *inputStream;
id <SKPSMTPMessageDelegate> delegate;
}
.m
[NSStream getStreamsToHostNamed:relayHost port:relayPort inputStream:&inputStream outputStream:&outputStream];
Any guidance will be greatly appreciated.
Thanks.
I have found right solution for this question.
The answer is: Dont bother yourself converting code manually.
You just need to add compiler flag -fno-objc-arc
to imported classes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With