Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@teffi
Copy link

@teffi teffi commented Jan 24, 2018

Added try-catch-finally to avoid fatal exception when loading image contents of a path or url.

Error internally in Apple's NSData trying to read from URL 'path to svg file'. Error = Error Domain=NSCocoaErrorDomain Code=256 "The file “svg filename” couldn’t be opened." UserInfo={NSURL=path to svg file}

Use:
+[SVGKImage imageWithContentsOfURL:completion:]
+[SVGKImage imageWithContentsOfFile:completion:]

@adamgit
Copy link
Contributor

adamgit commented Jan 24, 2018

Why have you created a new completion block for this?

The old block should be sufficient - but if not, please change ALL the instances, don't create a new, duplicate, typedef. Your new block forces peolpe to duplicate their code and handle both outcomes - and it also appears to discard critical information - you've lost ALL the parse data, no?

@teffi
Copy link
Author

teffi commented Jan 24, 2018

Sorry. I was trying to create a simpler and more straight forward block when one just needs the SVGKImage and not the SVGKParseResult object. If you feel strongly about reusing the existing typedef, sure.

Yes. I just noticed the wrong completion instance checking. The block is not invoked at all. Sigh

@adamgit
Copy link
Contributor

adamgit commented Jan 24, 2018 via email

@teffi
Copy link
Author

teffi commented Jan 24, 2018

Noted. Will keep that in mind.

@adamgit
Copy link
Contributor

adamgit commented Nov 23, 2018

UPDATE: now we've started a 3.x branch ... it's a good time to improve / fix any interfaces. I don't think this one is easy :) - there's a lot of information to handle (the extra metadata needed by the parser, the image that's created (or null), and the parse-errors, and separately the parse-log), but now is a good time to come up with a cleaner alternative if you have one in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.