cocoa

NSXMLNode children by name

I needed to parse some xml recently and found a neat little category to add to the NSXMLNode class. Basically this allows you to find a node by name.


@implementation NSXMLNode (utils)

- (NSXMLNode *)childNamed:(NSString *)strName {
NSEnumerator *e = [[self children] objectEnumerator];

NSXMLNode *node;
while (node = [e nextObject])
if ([[node name] isEqualToString:strName])
return node;

return nil;
}

- (NSArray *)childrenAsStrings {
NSMutableArray *ret = [[NSMutableArray arrayWithCapacity:
[[self children] count]] retain];

SOAP requests with Cocoa

I'm just trying to send some xml data to a soap server. While I may not have found the 'correct' way of doing it, I did find some information on sending data within the Apple documentation.


NSData *XMLdata = [soapXML XMLDataWithOptions:NSXMLNodePrettyPrint];
NSURL *webserviceURL = [NSURL URLWithString:@"http://soap.example.com/soap.php"];
NSMutableURLRequest *URLrequest = [NSMutableURLRequest requestWithURL:webserviceURL];
[URLrequest setHTTPMethod:@"POST"];
[URLrequest setValue:@"text/xml" forHTTPHeaderField:@"Content-type"];

base64 Encode

I'm writing a small export plugin for Apple's Aperture. While the sample FTP plugin does the job mostly, I needed something a little more feature rich for a web image gallery we have.

I started off by adding a receipt file to go alongside the image which included all the meta data to help categorise the image on the website. This worked reasonably well, along with a cron job to read the receipts and move the files.

Drupal blog App

I used the wordpress blogging app for the iPhone a few months ago and decided that I'd love one for drupal. So far I haven't found one so unless anyone else does one in the next month or so I'll start work on one. I need to plan the feature set before diving into code so if you stumble by this page and have suggestions, please leave a comment or use the site contact form to put forward your ideas.

iPhone Development

I have recently been questing heavily to get up to speed with my iPhone development. I've learnt a lot and I owe much of my knowledge to others. Now I can safely say I'm 'getting there' with my abilities on the device I'd like to share some of my knowledge with anyone who is interested.

I'll be covering anything relevant to either cocoa, os x dev and iPhone dev. Thanks to the NDA being lifted I can now do so without issue so here goes.

Syndicate content