cocoa

Can plists be securely read from untrusted source?

I need simple client-server communication with iPhone app, and XML property lists seem like quite easy and simple solution that saves me trouble of dealing with XML parser delegates and building these structures myself. I just wonder is it wise to use NSPropertyListSerialization class with external data? Are there any obscure plist feat...

Creating object named after the value of an NSString - is it possible?

Is it possible to create an object named after an NSString's value? If so, how? ...

NSPopUpButtonCell inside custom cell does not pop up when clicked.

I've created a custom subclass of NSCell with an NSImageCell, some NSTextFieldCells, and an NSPopUpButtonCell. I'm initializing the pop up cell using: myPopUpCell = [[NSPopUpButtonCell alloc] init]; [myPopUpCell setBordered:NO]; [myPopUpCell setAutoenablesItems:NO]; [myPopUpCell addItemsWithTitles:[NSArray arrayWithObje...

Provide Base Data for Core Data Application?

I'm working on a Core Data app (for iPhone 3.0, though I don't think that really makes a difference here) and it will need to ship with a "starter" database filled with data. With SQLite, I would just have the App copy the populated database from the bundle into the App's documents directory on first launch and then load that database - ...

best way to start learning Cococa in iPhone or OSX, espeicaly getting the big picture

Hi all, So I started my iPhone programming and have just uploaded my first game to the app store. However, I took the C++ & OpenGL & openFrameworks route, hence I am still entirely a newbie to the Cococa, Objective-C and the "authentic" Apple developer world. Right now I am learning through Beginning iPhone Development by Dav Mark, Jef...

programmatically recording sound sent to Built-in Output, Mac OS X

I have a conundrum: I need to find a way to capture the raw audio data that is being piped to the Built-in Output on Mac OS X. Core Audio, HAL, etc. I can "listen" in on the Built-in Output and the mic, but neither of these appear to offer the correct data stream - the exact stream (all combined data from all input sources) that goes ...

Search Open Directory (LDAP) With Objective-C

Does anyone have any sample code in objective-c for connecting to an external Open Directory server and searching a specific node like /Users/? I looked through the OD guide on Apple and I couldn't figure it out. Thanks! ...

Using a NSTreeController, NSOutlineView with Drag and Drop

I have found a Tutorial here on how to implement drag and drop in an Outline View. The only problem I have is I don't know where to put the code from the tutorial. I would appreciate it greatly if you could tell me where I should put the code in a Xcode Project to make it work. Thanks! ...

How do I draw an NSString at an angle?

Is there a set of string attributes I can specify that will draw the text at an angle when I call: [label drawAtPoint:textStart withAttributes:attributes]; ...

"isEqualToString" Cocoa error

Hello. I am getting an error in my console: 2009-05-30 20:17:05.801 ChuckFacts[1029:20b] *** -[Joke isEqualToString:]: unrecognized selector sent to instance 0x52e2f0 Here is my code that I believe the error is coming from: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexP...

Library for Image Recognition in Obj-C?

Hi there, I'm looking for some library that will allow me to identify black dots on a white background. Preferably in C or objective-c. Also, what keywords can I use in my search for such algorithms? I've found a lot of stuff about image recognition but nothing that ressembles what I'm looking for. thanks! ...

Enumerating installed browsers on OS X

How would one enumerate the installed browsers on an OS X system from a local app. I would like to build something like choosy, but different (long story). However, I would like to enumerate all installed browsers on the system. On windows, I can dive the installed browsers in the Default Programs registries, however, I don't believe th...

NSArray to Core Data items

Hey, I have an method that reads an xml file and stores the xml nodes at a certain XPath-path in an NSArray called *nodes. What I want to do is take each one of the items in the array and add it to a core data entity called Category with the attribute of "name". I have tried a number of different ways of creating the entity but I'm no...

How do I get the external ip address with NSHost?

I'm trying to find my external IP address, but I get local ones only, behind the NAT. NSArray *addresses = [[NSHost currentHost] addresses]; Is there a way to print out the public address? Using NSHost is it a good idea? ...

Open an NSWindow by clicking NSRect in cocoa

In my program I am able to determine whether a mouseclick was made within a certain NSRect. How can I open a new NSWindow by clicking this NSRect? ...

Cocoa: NSXMLParser - howto resolve entities defined in DTD

Hi, I use NSXMLParser to parse large XML files-- going good BUT :) I cant get the parser to resolve the external entities from the DTD. I googled and read documentation and older mails... and I did set parser.shouldResolveExternalEntities = YES I do get: - (NSData *)parser:(AQXMLParser *)parser resolveExternalEntityName:(NSString *)nam...

Implimenting NSText delegate methods in PyObjc and Cocoa

In the project that I'm building, I'd like to have a method called when I paste some text into a specific text field. I can't seem to get this to work, but here's what I've tried I implimented a custom class (based on NSObject) to be a delegate for my textfield, then gave it the method: textDidChange: class textFieldDelegate(NSObject):...

How can I convert hex number to integers and strings in Objective C?

Given the example of an array like this: idx = [ 0xe, 0x3, 0x6, 0x8, 0x2 ] I want to get an integer and string representation of each of the specified items in Objective C. I have mocked up a ruby example which works perfectly: 0xe gives 14 when i run 0xe.to_i and "e" when i run to_i(base=16) 0x3 gives 3 when i run 0x3.to_i and gi...

NSImage to Base64

I need to create a base64 string representation of an NSImage cocoa object. What's the best way of handling this, apple documentation seems to be a little short on the subject (or I just cant find it). Base64 encoding seems rather complex from the outside. Any help would be very much appreciated. Cheers Alex EDIT NSArray *keys = [NSA...

Core Data: Is it possible to build a desktop app to create the data model for an iPhone app with Core Data?

Hi, I'm currently in the process of deciding whether or not to use Core Data for managing the data in my iphone application. The application involves putting together a fairly sizeable library of content which needs to be localised and has a fair few relationships. One benefit I thought of using core data would be that I could perhaps b...