objective-c

How to serialize a Property List Storing NSNull

I want to store in a NSMutableDictionary some null values using NSNull and then serialize this data using a property list. Problem is NSNull is not allowed and I get "Property list is in invalid format" error. Is there a workaround for this? Seems very surprising they didnt put NSNull on the list of valid plist objects. Thanks, D ...

get file names to NSArray

I have images in Images folder, and i would like to initialize an array with strings of file name... ex: one.png, two.png, three.png I would like to initialize my array as ["one", "two", "three"] ...

Weird view, in UITableViewCell at editing mode, while reorder cells

Hi, iphone problem. http://errorimages.s3.amazonaws.com/weird_cell.png I am in editing mode. The dark grey is an imageView, that it seems being pushed by the reorder icons, and you can see the UIview in the background (light grey). I do not like this to happen. What do you think? ...

Objective-C category compared to Mixins

Is the concept of the Objective-C categories in anyway similar to the concept of mixins? If so: what are the similarities? In not: what are the differences? ...

Nested arrays in Objective-C ( NSMutableArray )

Hi, I'm trying to build a nested array: First, I make a "PlayerItems" array which will contain 10 arrays, each containing item objects, corresponding to the inventories of each player in the game. On the indicated line, I get the following error: error: void valued not ignored as it ought to be What is the void value here? If I use...

iPhone passcode lock meachanism

how can i develop the custom screen unlock for iphone as the one working in case of passcode lock active mode? ...

Opening popup links in UIWebView, possible?

Hey guys, I have a UIWebView which I'm using as an embedded browser within my app. I've noticed that links in webpages that open new windows are ignored without any call into my code. I've tried breakpointing on - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigation...

How I can set a date string from twitter to a NSDATE

The date you get back from twitter is in this format Fri Aug 07 12:40:04 +0000 2009. I am able to assign the value to a NSDate without issue. However, when I attempt to use NSDateFormatter, I get a nil returned to me. What am I missing? NSDate *createdAt = [messageData objectForKey:@"created_at"]; NSDateFormatter *format = [[NSDateFor...

iPhone Document Directory comes back null in distribution configuration

Hi, I'm trying to persist a value with a plist in the documents directory. I use the following code to get the document directories path: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; I'm ready to release this app so I am ...

Facebook iphone connection

I have the next problem with the connection: I can't connect to one app in facebook, but when I create a new app in facebook and I change the API and secret all is going good. The problem is that I need to connect to the first one app in facebook, the other was only to test the connection. What could be the solution? Thanks ...

Undo Management with Core Data

I'm trying to implement undo support using Core Data on the iPhone and I ran into a few problems. I currently have a couple of managed objects set up but when I make changes to their properties, these changes don't get recorded by the undo manager. From my understanding, Core Data is supposed to have this automatically set up and I shou...

objective-c if statement

So this is probably really simple but for some reason I can't figure it out. When I run the below code I can't get it to go into the if statement even though when I go into the debugger console in xcode and I execute po [resultObject valueForKey:@"type"] it returns 0. What am I doing wrong? Thanks for your help! NSManagedObject *resu...

Can I hook up an action within an NSCollection view via Interface Builder?

I have an NSCollection view. I want to connect a control in the replicated view either to an outlet my controller, passing in the representedObject, or to an outlet on the representedObject itself. Can I do this with IB or do I need to do this programmatically? ...

Access iPhone Mail inbox using native app. Possible?

I was asked to write a native iPhone to provide a filtered view of items in the Mail InBox. For instance, I may want to list out only the emails with text "Mac Tablet Gossip" inside the mail content. However, I don't need (or want) to access the inbox of the mail account, but instead I hope that I can just access the inbox on the device....

UITextField for Phone Number

Hello everyone, I was wondering how I can format the textField that I'm using for a phone number (ie like the "Add New Contact" page on the iPhone. When I enter in a new mobile phone, ex. 1236890987 it formats it as (123) 689-0987.) I already have the keyboard set as the number pad. Thanks! ...

error: expected specifier-qualifier-list before...in Objective C ?

Hi guys. Whenever I build the following code, I get the error above. //Controller.h #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import "PolygonShape.h" #import "PolygonView.h"; @interface Controller : NSObject { IBOutlet UIButton *decreaseButton; IBOutlet UIButton *increaseButton; IBOutlet UILabel *numberOfSi...

How to intercept text from the keyboard and format it before it show in the cell?

Part of the program I'm developing stores user-entered phone numbers, so I'd like to format them as they are entered. I've got the NSFormatter working when text is displayed in the cell from stored data, but I don't know how to format a phone number as it's being entered on the keyboard, as in Apple's contacts app. How can I accomplish ...

How to Extract AppleScript Data from a NSAppleEventDescriptor in Cocoa and Parse it

Hello! What I'm doing is executing an AppleScript inside of Cocoa. It returns some data as a NSAppleEventDescriptor, which NSLog() prints like so: <NSAppleEventDescriptor: 'obj '{ 'form':'name', 'want':'dskp', 'seld':'utxt'("69671872"), 'from':'null'() }> I want to take that data and turn it into a NSDictionary or NSArray, or someth...

Saving large objects to file

Hi everyone. I'm working on a project in Objective-c where I need to work with large quantities of data stored in an NSDictionary (it's around max ~2 gigs in ram). After all the computations that I preform on it, it seems like it would be quicker to save/load the data when needed (versus re-parsing the original file). So I started to l...

Removing a UITabBarController's view causes an EXC_BAD_ACCESS exception

I'm trying to remove a UITabBarController from a window in my app by calling removeFromSuperview on the controller's view after adding it to the window previously. However when i do so and after it deallocates all the view controllers that are on the bar successfully, i get an EXC_BAD_ACCESS signal after an autorelease pool is drained. ...