marcisme / sketch-preview

Sketch plugin to preview mockups in Skala Preview
MIT License
610 stars 37 forks source link

Not working in OS X 10.9 #15

Closed utom closed 9 years ago

utom commented 9 years ago

"Preview Setup" is not working, OS X 10.10 is working...

marcisme commented 9 years ago

Are there any errors in the system log? (Console.app)

marcisme commented 9 years ago

I looked through the API diffs for 10.10, and I don't see anything obvious that's changed since 10.9. Unfortunately I don't have the hard drive space to set up a 10.9 VM, so there isn't much I can do about this without additional information. If you (or someone else with 10.9) could provide the debug log, that would help identify the problem.

thorbenprimke commented 9 years ago

I'm running 10.9.3. I debugged it a bit but couldn't figure out why the following line [segmentedControl setLabel:sizeLabel forSegment:i] causes the error since all the data seems valid unless segmentedControl.segmentCount = config.PREVIEW_SIZE_LABELS.length does not work and since it wouldn't be initialized, causes the OutOfBounds exception.

12/24/14 3:36:14.982 PM Preview Setup... (Sketch Plugin)[98753]: DEBUG: failed to load config from: file:///Users/thorben/Library/Caches/com.marcisme.sketch-preview/config.plist 12/24/14 3:36:14.982 PM Preview Setup... (Sketch Plugin)[98753]: DEBUG: config: null 12/24/14 3:36:14.985 PM Preview Setup... (Sketch Plugin)[98753]: DEBUG: labelCount: 5 12/24/14 3:36:14.985 PM Preview Setup... (Sketch Plugin)[98753]: DEBUG: labels: 0.5x,1x,1.5x,2x,3x 12/24/14 3:36:14.986 PM Preview Setup... (Sketch Plugin)[98753]: DEBUG: sizeLabel: 0.5x 12/24/14 3:36:14.986 PM Preview Setup... (Sketch Plugin)[98753]: DEBUG: i: 0 12/24/14 3:36:14.986 PM Sketch[98753]: Exception: (null) 12/24/14 3:36:14.986 PM Preview Setup... (Sketch Plugin)[98753]: -[NSSegmentedCell setLabel:forSegment:]: index (0) beyond bounds (-1)

marcisme commented 9 years ago

Thanks for the debug info. I think the property syntax isn't working on 10.9, so the line that sets the segmentCount isn't doing anything.

Can you try this branch?

thorbenprimke commented 9 years ago

@marcisme that fixes it.

I'm still new to Sketch plugins / CocoaScript. Subtle difference between dot and bracket notation.

marcisme commented 9 years ago

@thorbenprimke Thanks for your help.

This should be fixed in v0.6.1.