- Posts: 2
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about iOS development and PDF
error: Implicit conversion of C pointer type...
- starcutdec
- Topic Author
- Offline
- New Member
-
Less
More
IP: 192.168.0.70
12 years 1 week ago #5605
by starcutdec
error: Implicit conversion of C pointer type... was created by starcutdec
Hi,
I tried to follow the instructions in help_iOS_1.7.pdf to include PDFViewer 2.9.7 in my existing iOS 5 project.
When I try to compile I get an error:
RDPDFViewController.m:65:19: Implicit conversion of C pointer type 'PDF_DOC' (aka 'struct _PDF_DOC *') to Objective-C pointer type 'PDFDoc *' requires a bridged cast
It's from the method:
- (int)PDFOpen:(NSString *)path withPassword:(NSString *)pwd
... and from the line:
[m_view vOpen:m_doc: self];
The similar line in the example project works fine.
I'm not very experienced iOS developer, but as far as I can understand it's a problem with Objective C <-> C++ interface? Any help is appreciated.
I tried to follow the instructions in help_iOS_1.7.pdf to include PDFViewer 2.9.7 in my existing iOS 5 project.
When I try to compile I get an error:
RDPDFViewController.m:65:19: Implicit conversion of C pointer type 'PDF_DOC' (aka 'struct _PDF_DOC *') to Objective-C pointer type 'PDFDoc *' requires a bridged cast
It's from the method:
- (int)PDFOpen:(NSString *)path withPassword:(NSString *)pwd
... and from the line:
[m_view vOpen:m_doc: self];
The similar line in the example project works fine.
I'm not very experienced iOS developer, but as far as I can understand it's a problem with Objective C <-> C++ interface? Any help is appreciated.
IP: 192.168.0.70
12 years 1 week ago #5609
by radaee
Replied by radaee on topic error: Implicit conversion of C pointer type...
PDF_DOC is struct in C language.
PDFDoc is obj-c class. it's different.
PDFDoc is obj-c class. it's different.
- starcutdec
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
IP: 192.168.0.70
12 years 1 week ago #5610
by starcutdec
Replied by starcutdec on topic error: Implicit conversion of C pointer type...
Thank you radaee for your reply. I can appreciate the fact that they are different.
However it's the unmodified example code from help_iOS_1.7.pdf and that compilation error doesn't occur in the example project which too has a similar line.
Maybe I'm missing some compilation flag etc.? I did use the -lstdc++ flag. I also double (even triple) checked that I did everything as is instructed in help_iOS_1.7.pdf but I might have misunderstood something.
While I have pretty long programming experience, I am rather new to Objective C.
What might cause the compilation error?
However it's the unmodified example code from help_iOS_1.7.pdf and that compilation error doesn't occur in the example project which too has a similar line.
Maybe I'm missing some compilation flag etc.? I did use the -lstdc++ flag. I also double (even triple) checked that I did everything as is instructed in help_iOS_1.7.pdf but I might have misunderstood something.
While I have pretty long programming experience, I am rather new to Objective C.
What might cause the compilation error?
IP: 192.168.0.70
12 years 1 week ago #5612
by stronglee
Replied by stronglee on topic error: Implicit conversion of C pointer type...
You can try add (__bridge void*) before error object,just like
id obj = [[NSObject alloc] init];
void *p = (__bridge void *)obj;
id o = (__bridge id)p;
This maybe cause by ios5 system.You can try the demo in ios6 and ios7.
id obj = [[NSObject alloc] init];
void *p = (__bridge void *)obj;
id o = (__bridge id)p;
This maybe cause by ios5 system.You can try the demo in ios6 and ios7.
- imran.nazeer
- Offline
- Junior Member
-
Less
More
- Posts: 27
- Thank you received: 0
IP: 192.168.0.71
11 years 11 months ago - 11 years 11 months ago #5992
by imran.nazeer
Replied by imran.nazeer on topic error: Implicit conversion of C pointer type...
This issue still exists for me.
If i convert like with ( [m_view vOpen:(__bridge PDFDoc *)(m_doc): self];
Application getting crash.
www.dropbox.com/s/cw9un5wz4bu3fey/Screen...t%205.22.43%20PM.png
If i convert like with ( [m_view vOpen:(__bridge PDFDoc *)(m_doc): self];
Application getting crash.
www.dropbox.com/s/cw9un5wz4bu3fey/Screen...t%205.22.43%20PM.png
Last edit: 11 years 11 months ago by sheeraz_am.
IP: 192.168.0.71
11 years 11 months ago #5995
by stronglee
Replied by stronglee on topic error: Implicit conversion of C pointer type...
Hi,which version demo you use?Could you show me some code where you use m_doc and definition of it?
Time to create page: 0.424 seconds