-
Notifications
You must be signed in to change notification settings - Fork 76
@media queries throwing exception #24
Comments
Thanks for reporting and including example and stack trace! Will look into it! Also have been meaning to update the docs as there are a few hidden features :) |
@cloudkite thanks for quickly looking into this, but unfortunately, after adding :head, updating pods and cleaning the project the problem still persist. I looked at the offending lines and I think that you can not call removeObjectAtIndex: while iterating copy of the array, because if you remove more than one object you will start removing invalid objects - indexes in copy will not be affected by removal but in the processed array indexes will change. Maybe use some kind of filter function or add valid items to new mutable array? Using removeObject: instead of removeObjectAtIndex: is suboptimal but it fixes the issue. |
Ah yeah good point! Might be better to do by adding to new array as you suggested, will fix it up later today or if you would like to submit a pull request please feel free. thanks! |
Sure, I'll send pull request in the morning. |
I had some free time so had a go at fixing it 76a8836 Let me know if you have any suggestions |
Fixed in v0.2.1 which should be in cocoapods soon |
First of all, I want to thank you for your hard work on this awesome project. I recently discovered that classy supports media queries, but following snippet of cas will throw exception when run on iPad (this also happens when using
@media iphone and (version:<7.0)
and removing@device iphone
:Stacktrace (line throwing exception is 106 in CASStyler.m, using 0.2.0 from cocapods):
The text was updated successfully, but these errors were encountered: