mapbox / Simple-KML

Simple KML is a simple & lightweight parsing library for KML written in Objective-C for the iOS platform.
BSD 3-Clause "New" or "Revised" License
208 stars 58 forks source link

add to CocoaPods #22

Open incanus opened 12 years ago

incanus commented 12 years ago

See also #21.

incanus commented 11 years ago

Someone added this for us per https://github.com/CocoaPods/Specs/commit/e93400aebf982a19efefd4f558f750a2ada33374 Need to check on it.

fabiomassimo commented 11 years ago

It turns out this error for [stream readDataOfLength:info.length]; No visible @interface

pixelogik commented 11 years ago

@fabiomassimo I have the same issue ( [stream readDataOfLength:info.length]; No visible @interface). Do you know a fix for this? Seems SimpleKML in CocoaPods is not using the right version of Objective-Zip?

fabiomassimo commented 11 years ago

I've solved by added this snippet of code in ZipReadStream.m:

- (NSData *)readDataOfLength:(NSUInteger)length {
NSMutableData *data = [NSMutableData dataWithLength:length];
int bytes = unzReadCurrentFile(_unzFile, [data mutableBytes], (unsigned)length);
if (bytes < 0) {
    NSString *reason= [NSString stringWithFormat:@"Error in reading '%@' in the zipfile", _fileNameInZip];
    @throw [[[ZipException alloc] initWithError:bytes reason:reason] autorelease];
}

[data setLength:bytes];
return data;
}

And obviously in ZipReadStream.h:

- (NSData *)readDataOfLength:(NSUInteger)length;
pixelogik commented 11 years ago

Cool, thanks! I just commented the code because I am not using ZIPs after all. But still, good to have this option.

incanus commented 11 years ago

I'm not actively maintaining the version in CocoaPods (and I didn't add it). Thanks for looking into this.

fabiomassimo commented 11 years ago

Another strange behavior in import from cocoa pods. Every time I trigger a pod install or pod update i have this error: libxml/tree.h file not found I've to added manually in Simple KML Header source path this string $(SDKROOT)/usr/include/libxml2 Anyone have founded a better solution?