navneet83 / Cross-platform-AES-encryption

Basic cross platform AES encryption
Apache License 2.0
320 stars 152 forks source link

Swift (2.0) errors and warnings (Not working) #28

Open Smponias opened 9 years ago

Smponias commented 9 years ago

Hey guys,

I wanted to try this cross-platform encryption and realized that it is not working with swift (2.0). There are a few errors and warnings.

  1. The errors in CryptLib.h can be fixed by importing UIKit:

    import < UIKit/UIKit.h > //Remove whitespaces

In NSData+Base64 I get two warnings and one error I can't fix.

  1. Warning: "Method definition for 'dataFromBase64String:' not found"
  2. Warning: "Array index 3 is past the end of the array (which contains 3 elements)

    outbuf [2] = ( ( inbuf[2] & 0x03 ) << 6 ) | ( inbuf[3] & 0x3F );
  3. Error: "'autorelease' is unavailable: not available in automatic reference counting mode'

Maybe someone can help me?

Upadte 1: I fixed the Error by turning off the "Objective-C Automatic Reference Counting" in my Build Settings