Friday, November 27, 2009

Update Released

1.1 has been released.

It fixes the bug with the server names that have spaces and the bug where an item would show the set name instead of the item name.

It also threads all the internet connections so they don't hold up the app while it's connecting and downloading.

Thursday, November 19, 2009

Warcraft Gear Compare FAQ

1) Is this app an account phisher?
- No, it does not ask for any account information. It is not required for full functionality.

2) Isn't there already a World of Warcraft Armory app from Blizzard?
- There is but that app and this app provide different functionality. See Below.

3) Can't I just use RatingBuster or the comparison function provided by Blizzard's UI?
- You can but this app takes things a few steps further. RatingBuster and the native Blizzard UI provide raw stat differences between the items. For example, you would see something like the following.

+16 Agility
-56 Critical Rating
+69 Haste Rating
+10 Attack Power
-11 Expertise Rating

This is useful, but not meaningful unless you know the weighted value of each stat. And if you knew those numbers, you would have to calculate the pluses and minuses to determine which one is better.

What this app does is take those raw differences and using the default weight values included, or ones defined by the user, and calculate a weighted score difference between the items. So instead of what you see above, you would simply see +121 or -189.56.

Wednesday, November 18, 2009

Warcraft Gear Compare Update

An update is in to fix a couple of bugs that were found and to thread the internet connections so they don't hang the app while they're connecting to armory. It's awaiting approval and should be in the app store sometime next week.

Tuesday, November 17, 2009

And it's approved!

The app has been approved and it's on the app store! Linky Linky.

Saturday, November 14, 2009

Still Waiting

So it's still waiting to be reviewed.

My friend turned me onto a new possible utility app for a game. I don't play it myself but according to her, it's pretty popular and there's little support for it on the app store. So I'll be starting research and design on that.

I also found an excellent OpenGL ES tutorial for the iPhone: . I like it because it starts from the very beginning and assumes you know nothing about OpenGL and graphics/game programming. Which I don't. This takes care of the programming part... I don't know that I will ever learn enough to do the graphics part. Fortunately, the same friend that turned me onto the new app idea is really into art and she's damn good at it. So maybe she can help on that end. I'll have to find out if she knows how to do 3D stuff or is willing to learn it.

And I'm also fleshing out 3-4 game ideas for when I know enough to actually make something.

Saturday, November 7, 2009

Submitted for Approval!

It was submitted for approval last night. Took a little longer to finish than I thought but it was my first app. All in all, I'm happy with the results. Now I need to think about another idea for an app while I attempt to learn the OpenGL stuff. I've never done graphics before and I suck at art but we'll see what happens.

Anyways, the app is Warcraft Gear Compare, or just Gear Compare. You search the WoW Armory for an item that just dropped, it loads your currently equipped items from Armory, and using weighted values, calculates which item is better. It comes preloaded with 30 specs and the weights were taken from wowhead and the elitistjerks' forums. You can edit the specs or create your own weights to cater to your need.





Thursday, November 5, 2009

NSURLConnection subclass

So I wanted a way to handle multiple NSURLConnections for different functional areas. The problem with the normal NSURLConnection is the inability to distinguish between the different connections unless you look at the URL.

Which is fine, but just looking at the URL doesn't help when I have multiple objects that use similar URLs and need to keep them separated. One common solution you find on the internet is to subclass NSURLConnection and add a tag variable. Which is what I did, but I needed more than just that.

I also didn't want to have to keep track of multiple sets of data from the different connections so I created a variable for the data and overloaded the methods that send delegate responses to handle the data.

Now it's getting closer to what I wanted. The last thing I wanted was there was only one instance of a connection for each tag. So I created a class variable to handle that.

So in the end, what I had was an NSURLConnection subclass that handles multiple tagged connections with the response data contained in the connection and limiting the connections to 1 instance of each tag.


Anyways, here's the subclass definition:

#import

NSMutableDictionary *instances;

@interface tagConnection : NSURLConnection {

NSString *connID;

NSMutableData *receivedData;

}

@property (retain) NSString *connID;

@property (retain) NSMutableData *receivedData;

+ (void)checkTag:(NSString *)tag Target:(tagConnection *)target;

+ (void)removeTag:(NSString *)tag;

- (id)initWithTag:(NSURLRequest *)request delegate:(id)delegate startImmediately:(BOOL)startImmediately connID:(NSString*)tag;

@end


And this is the class implementation:

#import "tagConnection.h"


@implementation tagConnection

@synthesize connID;

@synthesize receivedData;


+ (void)initialize {

instances = [[NSMutableDictionary alloc] init];

}


+ (void)checkTag:(NSString *)tag Target:(tagConnection *)target{

tagConnection *tempConn = [instances objectForKey:tag];

if (tempConn != nil) {

[tempConn cancel];

[tempConn release];

}

[instances setObject:target forKey:tag];

}


+ (void)removeTag:(NSString *)tag {

[instances removeObjectForKey:tag];

}


- (id)initWithTag:(NSURLRequest *)request delegate:(id)delegate startImmediately:(BOOL)startImmediately connID:(NSString*)tag {

self = [super initWithRequest:request delegate:delegate startImmediately:(BOOL)startImmediately];

if (self) {

self.connID = tag;

receivedData = [[NSMutableData alloc] initWithLength:0];

[tagConnection checkTag:connID Target:self];

}

return self;

}


- (void)dealloc {

[tagConnection removeTag:connID];

[receivedData release];

[connID release];

[super dealloc];

}


- (void)URLProtocol:(NSURLProtocol *)protocol didReceiveResponse:(NSURLResponse *)response cacheStoragePolicy:(NSURLCacheStoragePolicy)policy {

[receivedData setLength:0];

}


- (void)URLProtocol:(NSURLProtocol *)protocol didLoadData:(NSData *)data {

[receivedData appendData:data];

}

@end


And here is some sample code of how to implement the subclass:

- (void)applicationDidFinishLaunching:(UIApplication *)application {

NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://wwww.yahoo.com"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:15];

[theRequest setValue:@"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4" forHTTPHeaderField:@"user-agent"];

tagConnection *testConn1 = [[tagConnection alloc] initWithTag:theRequest delegate:self startImmediately:YES connID:@"test"];

tagConnection *testConn2 = [[tagConnection alloc] initWithTag:theRequest delegate:self startImmediately:YES connID:@"test"];

}


- (void)connection:(tagConnection *)connection didFailWithError:(NSError *)error {

[connection release];

}


- (void)connectionDidFinishLoading:(tagConnection *)connection {

[connection receivedData]; //Do something with the data;

[connection release];

}

Getting close to release

Getting real close to finishing now. At first the programming went really fast because I was mostly sticking to stuff I had learned. That was the first 3-5 days. And I was going at such a quick pace I thought I would have been able to finish it by the end of that week.

But then I started to get into the stuff where I didn't have as much experience, i.e., sqlite3, libxml2, and url connections. Those each held me up a while until I could figure out how to work them. On the plus side, I think I was able to come up with a handy NSURLConnection subclass that I will implement at some point to handle the asynchronous connections that I make to the World of Warcraft Armory. But I might have that along with a few other features I want to add for a future update. Right now I just want to get a working version out onto the app store.

My revised completion date is by the end of this weekend. Which means it won't be approved (hopefully) by Apple and be up on the app store for another week. In the mean time, I will work on an update to thread more functions and add functionality.

I'll post my subclass a little later. And my next post after that will be when I finish the app and submit it for approval.