Giter Club home page Giter Club logo

Comments (10)

gloparco avatar gloparco commented on May 26, 2024

Just to add to it, here is a long discussion on the topic (from a site that I had never heard of before):

http://youranswers.info/question/view/en/YUhSMGNEb3ZMM04wWVdOcmIzWmxjbVpzYjNjdVkyOXRMM0YxWlhOMGFXOXVjeTh4T0RrMk1qYzBNaTkxYVhSbGVIUjJhV1YzTFd4cGJtc3RaR1YwWldOMGFXOXVMV2x1TFdsdmN5MDM=

I'm not sure if this can be prevented by your code, but it might be worth looking into. It seems to have something to do with AttributedString, but it does not appear to be certain.

from activelabel.swift.

schickling avatar schickling commented on May 26, 2024

Hi @gloparco! Thanks for reporting this.
We're using ActiveLabel just as part of a UITableView, so we haven't had this issue so far and unfortunately don't have the capacity at the moment to look into it in depth.

However we'd be more than happy to merge a PR which resolves this issue.

from activelabel.swift.

ammerzon avatar ammerzon commented on May 26, 2024

@gloparco I am using ActiveLabel in an UITableViewCell but every time i set a text containing an @ or # I get a NSRangeException.

from activelabel.swift.

polqf avatar polqf commented on May 26, 2024

Hi @byAmmerix, in what SDK and iOS version have you noticed it?

from activelabel.swift.

ammerzon avatar ammerzon commented on May 26, 2024

I am using:
Cocoapods: pod 'ActiveLabel', '~> 0.4'
iOS version/SDK: 9.2

It is the same bug as @JaviSoto already mentioned in #40.
The crash occurs at:
mutAttrString.setAttributes(attributes, range: element.range)

from activelabel.swift.

alexbredy avatar alexbredy commented on May 26, 2024

+1 happens to me every time i close and reopen a given tableview repeatedly.

from activelabel.swift.

polqf avatar polqf commented on May 26, 2024

@alexbredy what dependency manager are you using? iOS and SDK version?

from activelabel.swift.

alexbredy avatar alexbredy commented on May 26, 2024

Hi @poolqf

Using Cocoapods with
iOS version 9.2.1 and SDK 9.2 (Xcode 7.2.1)

Update regarding the issue I'm having:
The crash does not occur if I'm not adding cells upon opening the tableview. Somehow when I keep adding rows with the same url it crashes after 4-5 times closing and reopening the tableview.

The crash does not happen if the cells are unaltered.

from activelabel.swift.

adergaard avatar adergaard commented on May 26, 2024

The problem is most likely possibly due to row 190 in ActiveLabel.swift:

dispatch_async

Quickfix: Comment out that row (and consequently the closing } on row 194) and let the commands execute on the main thread instead and the crash is no more.

Be very careful trying to do stuff outside the main thread.
It's therefore also well worth noting the dispatch_after call made in the onTouch method.

from activelabel.swift.

polqf avatar polqf commented on May 26, 2024

I've removed the dispatch_async in #47
I am now going to create a new release. Closing this issue.

Feel free to reopen it if it happens again

cc/ @byAmmerix , @alexbredy , @JaviSoto

from activelabel.swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.