Cocoa Library
This is a Cocoa library that enables the user to find the country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code and weather that any IP address or hostname originates from. It has been optimized for speed and memory utilization. Developers can use the API to query all IP2Location™ binary databases for applications written in C or supporting static/dynamic library.
IP2Location Cocoa Library (958.39 kB)
Version: 5.0.0
Installation
- Download and decompress Cocoa library.
unzip ip2location-cocoa-x.x.x.zip - Download IP2Location C library at here.
- Decompress C library.
tar ip2location-c-x.x.x.tar.gz - Copy C library into same directory with IP2Location.xcodeproj.
cp ip2location-c-x.x.x ip2location-cocoa-x.x.x - Open IP2Location.xcodeproj with XCoder and make sure all libraries path are correct, and without any error.
- Change the path of IP2Location BIN database in main.m.
- Compile the project.
Sample Codes
require 'IP2Location'
#import <foundation/nsautoreleasepool.h>
#import <foundation/nsstring.h>
#import "IPLocation.h"
int main (int argc, const char *argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString *dataPath = @"IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE-SAMPLE.BIN";
NSString *ip = @"55.207.38.82";
IPLocation *loc = [IPLocation locationWithIP:ip dataPath:dataPath];
printf("* * * * * IP %s * * * * *:\n%s", [ip UTF8String], [[loc description] UTF8String]);
[pool drain];
return 0;
}
Credit: Thanks to Kevin Wojniak for codes contribution.
Sample Database (BIN)
Evaluation version of the database file having limited range of IP address information. You can query all IP addresses from 0.0.0.0 to 99.255.255.255 only.
- IP2Location™ DB1 Sample BIN database (308.92 kB)
- IP2Location™ DB2 Sample BIN database (38.45 MB)
- IP2Location™ DB3 Sample BIN database (10.75 MB)
- IP2Location™ DB4 Sample BIN database (43.54 MB)
- IP2Location™ DB5 Sample BIN database (16.86 MB)
- IP2Location™ DB6 Sample BIN database (50.08 MB)
- IP2Location™ DB7 Sample BIN database (48.64 MB)
- IP2Location™ DB8 Sample BIN database (55.54 MB)
- IP2Location™ DB9 Sample BIN database (18.88 MB)
- IP2Location™ DB10 Sample BIN database (58.38 MB)
- IP2Location™ DB11 Sample BIN database (19.27 MB)
- IP2Location™ DB12 Sample BIN database (58.77 MB)
- IP2Location™ DB13 Sample BIN database (17.80 MB)
- IP2Location™ DB14 Sample BIN database (59.42 MB)
- IP2Location™ DB15 Sample BIN database (20.60 MB)
- IP2Location™ DB16 Sample BIN database (62.02 MB)
- IP2Location™ DB17 Sample BIN database (22.22 MB)
- IP2Location™ DB18 Sample BIN database (67.82 MB)
- IP2Location™ DB19 Sample BIN database (57.30 MB)
- IP2Location™ DB20 Sample BIN database (69.40 MB)
- IP2Location™ DB21 Sample BIN database (22.59 MB)
- IP2Location™ DB22 Sample BIN database (72.02 MB)
- IP2Location™ DB23 Sample BIN database (57.63 MB)
- IP2Location™ DB24 Sample BIN database (72.57 MB)
