You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Objective-C provided getter does not match requirement's selector #143
I'm having trouble converting my old source to Swift 3.0 in following area. I've this following usage which was working prior to the version 3.
extension NewManPhoto: FICEntity
{
internal var UUID: String!
{
if _UUID == nil
{
// MD5 hashing is expensive enough that we only want to do it once
let imageName: String = sourceImageURL.lastPathComponent
let UUIDBytes: CFUUIDBytes = FICUUIDBytesFromMD5HashOfString(imageName)
_UUID = FICStringWithUUIDBytes(UUIDBytes)
}
return _UUID;
}
}
New XCode starts giving me following error: 'UUID' has been renamed to 'uuid'
But when I looked inside the FICEntity file I noticed it had 'UUID' only:
*@Property (nonatomic, copy, readonly) NSString UUID;
Anyway, after accepting Xcode's auto-fix suggestion it became small-case, but pops another error: Objective-C method 'uuid' provided by getter for 'uuid' does not match the requirement's selector ('UUID')
The code became something like this:
internal var uuid: String!
@objc(UUID) {
But beside it fixed, XCode erupt same error again to the line Objective-C method 'uuid' provided by getter for 'uuid' does not match the requirement's selector ('UUID') and the problem continues until the source became looks ugly and non-fixable.
I'm not sure if this the right way to overcome the said problem, but following syntax seems accepted by XCode; can you give your suggestion if this should work (I yet to fix other errors so unable to run the app at this moment to test):
@objc(UUID) internal var uuid: String!
{
if _UUID == nil
{
// MD5 hashing is expensive enough that we only want to do it once
let imageName: String = sourceImageURL.lastPathComponent
let UUIDBytes: CFUUIDBytes = FICUUIDBytesFromMD5HashOfString(imageName)
_UUID = FICStringWithUUIDBytes(UUIDBytes)
}
return _UUID;
}
Activity
santanu4ver commentedon Nov 8, 2016
I'm not sure if this the right way to overcome the said problem, but following syntax seems accepted by XCode; can you give your suggestion if this should work (I yet to fix other errors so unable to run the app at this moment to test):