objective-c

How to clear cookies from NSHTTPCookieStorage more then once?

My desktop app connects to a web application that's hosted on Google App engine. Once it authenticates it gets an authtoken cookie that it passes along for all future requests. That all works. But now I want to add "Sign out". I’ve tried to implement Sign Out like this: - (void)signOut { NSHTTPCookieStorage *cookieStorage = [NSHTTP...

Selector element does not have valid object type (Cocoa touch)

Hi I'm trying to iterate over a collection of objects and create an annotation for each object as seen in this code, but at the closing } of the for loop i get this error Selector element does not have valid object type. What does this mean? for (POI myPOI in appDelegate.pois){ CLLocationCoordinate2D location; location.l...

Cocoa PDFKit Unlocking Encrypted Files

Hi all I have a PDF document that has an owner password set but no user password. Therefore it is encrypted. I know the owner password and want to use PDFKit to confirm when the document has been decrypted. I have used the PDFDocument unlockWithPassword method which returns YES when the file is unlocked. However this method also retur...

comma separated thousand NSString stringWithFormat

Is it possible to display 1000.99 as 1,000.99 using [NSString stringWithFormat:@"£%0.2f", 1000.99] Please guide me if I am not on the right track to achieve this? ...

Homework: Figuring Out a Calculator's Forumla

So I've made easy math programs with C before, but my task at hand is a bit complex for where my knowledge is at the moment. I need to take the calculator found here (calculator: http://ohts.wustl.edu/risk/calculator.html, appendix which covers it a bit: http://ohts.wustl.edu/risk/formula.html) and program it into a ObjC program. I'm ha...

getting the specific ip location for iphone application.

I have gone through following link http://zachwaugh.com/2009/03/programmatically-retrieving-ip-address-of-iphone/ & I have also tried this one ( but this isn't recognized by apple ) http://appsamuck.com/day4.html Oke let me specify what is my need .. . .. I just want that when user tap on "wifi" button. Reports stored in documents...

Is there a delegate method that gets called when the user pressed "Retake" on the iPhone?

I have a UIImagePickerController subclass, and I would like to detect when the user presses the "retake" button. Is that possible... what delegate method gets called? I looked at the docs but I can't find anything: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIImagePickerControllerDelegate%5FProtocol/UIImage...

What is Best Approach to Learning iPhone App Dev?

I have basic C knowledge. I am trying to learn iPhone App Development. Should I first learn ObjC for Mac, using the book by Stephen G. Kochan, then move to transforming these principles to iPhone Dev? Or would learning ObjC without specific iPhone app tutorials first confuse me later when I try to move my ObjC knowledge to iPhone App de...

memory management: am i doing something wrong here?

Hi, In a very small number of cases in my iphone app, I get a crash after the for loop in the code below: ABAddressBookRef addressBookInit = ABAddressBookCreate(); CFMutableArrayRef abContacts = (CFMutableArrayRef)ABAddressBookCopyArrayOfAllPeople(addressBookInit); // get array of all contacts CFArraySortValues (abContacts, CFRangeMake...

Adding effects to a MP4 Video?

I'd like to do several things to a MP4 video, but I am not sure where to start. Some things I'd like to do: - Change the color of the video to Black & White, Sepia, etc. - Add animations, such as fade in, fade out, custom images/text moving around - Embed text into the video Essentially, the basic features of a video editing program....

keyUp event heard?: Overridden NSView method

UPDATED: I'm now overriding the NSView keyUp method from a NSView subclass set to first responder like below, but am still not seeing evidence that it is being called. @implementation svsView - (BOOL)acceptsFirstResponder { return YES; } - (void)keyUp:(NSEvent *)event { //--do key up stuff-- NSLog(@"key up'd!"); } @end --OR...

iPhone SDK: viewDidLoad() sees an empty NSArray, but it's populated in a delegate method (MGTwitterEngine)

This is probably obvious, but I'm a bit of a newbie and have spent hours trying to figure this out. In viewDidLoad() I have a call to a function on an MGTwitterEngine object (custom object), with an input. If the request (to Twitter, in this case) is successful, it calls an appropriate delegate method. In viewDidLoad(), it's like thi...

Core Data + Core Animation/CALayer together??

I am making an Cocoa app with custom interfaces. So far I have implemented one version of the app using CALayer doing the rendering, which has been great given the hierarchical structure of CALayers, and its [hitTest:] function for handling mouse events. In this early version, the model of the app are my custom classes. However, as the ...

Comparing two NSDates and ignoring the time component

What is the most efficient/recommended way of comparing two NSDates? I would like to be able to see if both dates are on the same day, irrespective of the time and have started writing some code that uses the timeIntervalSinceDate: method within the NSDate class and gets the integer of this value divided by the number of seconds in a da...

Getting and Setting values from Core Data elements in Objective-C?

I've got a simple application with two entities: Person: Attributes: name Relationships: nativeLanguage: (<<-> Language.natives) nonNativeLanguage: (<<-> Language.nonNatives) Language: Attributes: name Relationships: natives: (<->> Person.nativeLanguage) nonNatives: (<->> Person.nonNativeLanguage) On the ed...

Adding A Visual Timer To A View, iPhone

Hello all, I have a view (splash screen) which displays for two minutes: - (void)applicationDidFinishLaunching:(UIApplication *)application { [viewController showSplash]; } - (void)showSplash // Show splash screen { UIViewController *modalViewController = [[UIViewController alloc] init]; modalViewController.view = modelView; [se...

Core Data: entity properties getting mixed

I have an NSWindow which I use to create new records. After pressing the Add button, a certain method is called in which I do the following: - (IBAction)addActionAddSheet:sender { NSManagedObjectContext *moc = [self managedObjectContext]; NSManagedObject *newObject = [NSEntityDescription insertNewObjectForEntityForName:@"Recipe" inM...

How to write a GUI wrapper around a command line program in *C*?

System(); is able to call a program in PATH. How is it possible to send stdin read from e.g. a text field on a GUI to a command line program such as ftp, sftp ... with their own prompts? System() waits for a program to quit, but ftp does not without user interaction. It's also not possible to create a batch file since it's read only one ...

Using NSArray with Monotouch

Hi, How to insert items into NSArray object in C# (Monotouch)? I don't find appropriate method to do so? In Objective-C side, there is a constructor called "initWithObjects" but I don't find this on C# side. pom ...

if parentViewContoller statement

I'm writing a program with a UITableView with and add button in the Navigation Bar which leads to an edit page. When you click on an item in the table, a view (rView) is pushed with information pertaining to that item. This view has an edit button that also leads to the edit page. Is there a way that I could put an if statement for the ...