slycrel/JSTileMap

JSTileMap doesn't compile on mac. (was:ARC Semantics Issues)

Closed this issue · 11 comments

Hello,

I just started playing around with Sprite Kit, and I'm trying to incorporate JSTileMap into my project. However, I downloaded the latest source from Github, and it won't compile JSTileMap.m. It fails with:

JSTileMap.m:471:28: No known class method for selector 'imageWithContentsOfFile:
JSTileMap.m:472:21: Property 'size' not found on object of type 'CIImage *'
JSTileMap.m:542:11: No visible @interface for 'NSCoder' declares the selector 'encodeCGSize:forKey:'
JSTileMap.m:543:11: No visible @interface for 'NSCoder' declares the selector 'encodeCGSize:forKey:'
JSTileMap.m:547:11: No visible @interface for 'NSCoder' declares the selector 'encodeCGSize:forKey:'
JSTileMap.m:560:27: No visible @interface for 'NSCoder' declares the selector 'decodeCGSizeForKey:'
JSTileMap.m:561:31: No visible @interface for 'NSCoder' declares the selector 'decodeCGSizeForKey:'
JSTileMap.m:565:28: No visible @interface for 'NSCoder' declares the selector 'decodeCGSizeForKey:'
JSTileMap.m:801:11: No visible @interface for 'NSCoder' declares the selector 'encodeCGSize:forKey:'
JSTileMap.m:261:11: No visible @interface for 'NSCoder' declares the selector 'encodeCGSize:forKey:'
JSTileMap.m:271:30: No visible @interface for 'NSCoder' declares the selector 'decodeCGSizeForKey:'
JSTileMap.m:311:11: No visible @interface for 'NSCoder' declares the selector 'encodeCGSize:forKey:'
JSTileMap.m:321:11: No visible @interface for 'NSCoder' declares the selector 'encodeCGPoint:forKey:'
JSTileMap.m:331:32: No visible @interface for 'NSCoder' declares the selector 'decodeCGSizeForKey:'
JSTileMap.m:346:25: No visible @interface for 'NSCoder' declares the selector 'decodeCGPointForKey:'
JSTileMap.m:370:11: No visible @interface for 'NSCoder' declares the selector 'encodeCGPoint:forKey:'
JSTileMap.m:381:33: No visible @interface for 'NSCoder' declares the selector 'decodeCGPointForKey:'
JSTileMap.m:475:2: Unknown type name 'UIImage'; did you mean 'CIImage'?
JSTileMap.m:475:20: Unknown receiver 'UIImage'; did you mean 'CIImage'?

Is there something I'm missing? Do I need to turn ARC off, or is this supposed to be compatible with ARC?

Thank you,
Alex

I don't think thats ARC related. it doesn't seem to be able to find some things. I would check your code to make sure you didn't include a premature "@EnD" or curly brace.

Agreed, I don't think this is arc related. I've recently added JSTileMap to a project and have had no issues... Can you reproduce this in a blank sample project or share your project here so we can have a look?

I couldn't find a problematic "@EnD" or curly brace. I literally opened a new SpriteKit project, and in the initWithSize I created a map and added it to the scene. Just in case I'm being dumb, I'll upload the MyScene.h and MyScene.m here? If you need the whole project, I can zip it up too.

MyScene.h: http://pastebin.com/CXVTSYSV
MyScene.m: http://pastebin.com/VYSe1kM5

Just made a test app here with the latest code and your pastes, it works fine. We may need to see the project.

One thing to try is delete your existing copy of JSTileMap.m/.h and replace them with a newly downloaded copy.

I just tried deleting the existing one, and then cloned the repo and got the JTTileMap.h/m from JSTileMapSample/. It still failed to work. I also tried creating a brand new project, didn't edit the SpriteKit Template code, to see if it would compile the JSTileMap, and it still failed. I have uploaded the .zip with that new one that gives the same error:

Box.net link to TestBuild.zip: https://app.box.com/s/s1ctvtzm1kpeyaml97o0

Ah.

JSTileMap doesn't officially support mac applications (yet!) Have a look at this commit of one of the forks, see if that helps you some. I haven't tested it, but it should be pretty straightforward to make work on the mac.

mk2@27aa808

If you're looking for an iOS build, when you make a new project choose an iOS application (likely you want the spritekit based one).

I've been meaning to get around to looking at this and one other improvement for better performance from another fork. I'll see if I can get to merging this stuff in... hm... A week or two, depends on how my evenings/weekend goes the next while.

Thanks, I didn't know it wasn't for mac. Thank you for the pointers to the fork, I'll check it out! Thanks for the great library!

@alexlhoffman hey, just wanted to follow up here and find out how this went for you?

Hello, sorry I didn't give feedback. I checked out the fork for mac, and then I merged the commits you made to the master, and it worked perfectly (or at least, I was unable to find any obvious flaws). Thank you again for the excellent library, it works great!

No worries, there is no feedback requirement. :D I appreciate it! That's on my list of things to merge into the main branch but haven't had a chance to play with it much yet. Hopefully this week it will get in there.
Also, glad it's working out for you!