Closed QuentinDela closed 8 years ago
Hi @QuentinDela,
Thanks for the detailed issue.
Unfortunately I haven't been able to reproduce the issue you're having. The code seems pretty similar to what I have in my example project. Is it at all possible for you to extract your Table View Controller and related code into a separate Xcode project and attach that here so I can debug it?
On a side note, Swift naming convention states that your property names should start with a lower case letter. Only classes/structs and other types should start with a capital letter. It might be confusing for other Swift developers when they look at your code.
Also your TableAvatarImageConfig should be as follows:
struct TableAvatarImageConfig: AvatarImageViewConfiguration {
let shape: Shape = .Circle
}
A static member does not meet the requirements of the protocol so the shape will still be square.
Neither of these things is causing the issue you're having though which is why I'd appreciate if you could extract your code into a sample project!
Cheers, Ayush
Hello Ayush,
Thanks for your quick reply. I am not sure how to extract my code into a sample project. Here is a gist with the TableViewCell and the TableViewController. https://gist.github.com/QuentinDela/5fc069aec9b7289107017e77fb9286d0
Thanks a lot for your help.
Thanks for the gist. I've copied your code (minus the Realm stuff) into an example project and it works just fine for me. Please see the attached project.
The exception you are getting is memory related. It happens when you try to call a method on something that has already bee deallocated. Unfortunately without being able to reproduce and debug this issue, I won't be able to help much :(. Could you please try and reproduce the issue in the sample project I have just attached? If you are able to do it, please re-attach your version in another comment and I will debug and investigate what is going wrong.
Closing due to inactivity ...
@QuentinDela @ayushn21 Old issue but I was facing the same thing. Turns out the fix was pretty simple. I had only set the UIImage class to AvatarImageView and not the module to the same. By default it sets itself to no module when the class is set to AvatarImageView. I hope this helps someone in future.
Amazing library though.
Hi, Thanks a lot for pod! I am trying to implement it into my app but I am running into an issue. I'm trying to add it in a cell of my table view controller. I am using swift 2.2 and the pod "AvatarImageView", '1.1.1'
Here is my table_cell file
`import UIKit import AvatarImageView
struct TableAvatarImageConfig: AvatarImageViewConfiguration { static let shape: Shape? = .Circle }
class ContactPageTableViewCell: UITableViewCell {
}
I have an error or the line
ContactPageImageView.configuration = TableAvatarImageConfig()` EXC_BAD_ACESS (code=2, adress=0x7f9f74d3d1b0)Any ideas of what I'm doing wrong?
Thanks