2

My project is in swift language. I have used cocoa pods with project. I integrated HDAlerts in my project using cocoa pods. HDAlerts is in objective-c, So I added objective-c bridging header in project and imported Alerts.h file in it.

Problem is I can not use Alerts.showAlertWithMessage function, it gives me compile time error

Alerts.types does not have a member named 'showAlertWithMessage'.

I checked objective c header file and all other objective c classes I have imported are accessible and also the method is a class method and is accessible by command + click. Kindly help me to get rid of this problem.

You may find my code here: http://expirebox.com/download/553ac9f4734d551d4b2bc1d4e9de0e57.html

HarshIT
  • 4,583
  • 2
  • 30
  • 60
  • Plz refer this link it might help you . http://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift – Milap Kundalia Jan 17 '15 at 13:05
  • 1
    You should have added the link to the sample code that you are using.... – Leena Jan 20 '15 at 07:09
  • @Leena , Thanks for your response. I have uploaded a similar code at following url: http://expirebox.com/download/553ac9f4734d551d4b2bc1d4e9de0e57.html – HarshIT Jan 20 '15 at 13:12
  • It's obvious @Daij-Djan, because the Alert class was in pods. So it's necessary to keep pods. If you want to remove pods, kindly download the Alert class from GitHub – HarshIT Jan 20 '15 at 14:48
  • obviously Ill do neither - provide a working sample or some code in the question maybe – Daij-Djan Jan 20 '15 at 14:49
  • @Daij-Djan, kindly download the code again and run it. It will work. If you are not familiar with cocoa pods then I would like to inform you that run the workspace – HarshIT Jan 20 '15 at 14:50
  • now fails with missing some resources. Ill try with pods tomorrow – Daij-Djan Jan 20 '15 at 15:02
  • Ok, no problem but I don't understand why are you not able to run ! I tried with 4 different systems and it runs fine. By the way thanks for your time @Daij-Djan – HarshIT Jan 20 '15 at 15:03
  • Yes @Leena, I agree with you. Until I don't get correct answer I will have to use it by changing to NSArray. But there should be some way to access such methods !! – HarshIT Jan 21 '15 at 08:53

0 Answers0