cocoa

how to pass local path to NSXMLParser

how to pass local path to NSXMLParser like this NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:storePath]; where storepath is a local path like this: /var/mobile/Applications/56EEB906-2B73-493C-9BE7-2732440CDB69/Documents/xml1.php and my code is like this: //NSURL *urla = [[NSURL alloc] initWithString:storePa...

Color differences between cocoa and photoshop

I'm having some trouble with colors in interface builder and cocoa. I built out my interface in photoshop, and when i copy the RGB values from photoshop and set my UI elements in interface builder, or through code, the colors are not even close. I've messed around with setting color profiles in photoshop but can't seem to find one that m...

UITableView Not Scrolling With UISearchBar

What I want to achieve is a UISearchBar that moves up and covers the UINavBar, and contains a cancel button on the right of it. All goes well, until I use the following line of code: searchDC = [[[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self] autorelease]; What ends up happening is the UITableVi...

Core data: can NSFetchedResultsController fetch two different entities?

I am working on an iPhone app, and in a particular view I need to load two different entities: One that will populate a UITableView, and another that will populate a UITextView. Is it possible to fetch both properties using a single NSFetchedResultsController? Or do I need to use two different NSFetchedResultsController? Any ideas on...

Streaming SAX XML Processing on iPhone

NSXMLParser allows SAX parsing of either an NSData block or from a URL source. The problem is that both these methods require the entire XML source to be known before parsing begins. Suppose I have a stream of XML Data (say a sequence of NSData objects) and I want to process the stream using NSXMLParser or another cocoa class, how can ...

How to use webkit show utf-8 character with my cocoa app?

I have a cocoa app with a webkit to show somethink like utf-8 , but when the webkit to show utf8 character, it should show wrong character and I didn't know that , how to set the webkit show utf-8 character in my cocoa app? ...

how to create a navigation bar programmatically

i have a view in which i have table view and when user taps these cells in tabel view it gets loaded another view .. like this i have view hierarchy and i need a navigation bar at bottom of my view whatever is the view currently visible in this heirarchy and i need to place 3 buttons on it ... home,about,visit... if any suggestions appr...

How do I ensure proper KVO behaviour for my NSSlider-like custom control?

Hi, Let's say you have a custom control similar to NSSlider but with support for choosing a range of values, instead of a single value. The obvious choice of properties is minValue, maxValue, leftValue, rightValue, or however you wanna name them. You'd probably also want to make sure that leftValue and rightValue always lay in between m...

XCode Documentation - Offline Reading

Is it possible to have the iOS and OSX documentation available for offline reading? If so, how? ...

Core Animation Callbacks

I'm using core animation to transition between different view states in my application. However, I need to find a way to perform different tasks after the animations finish. I understand I can implement a delegate method and use the - (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag; callback, however there's no ...

How to set value of NSComboBox by KVC?

I have several NSComboBoxes created in Interface Builder, and one created programmatically. The NSComboBoxes created in Interface Builder are perfect. I have their Value bound to the Shared User Default Controller, and when their view is opened they are sitting there with the correct value. Importantly, this value is shown as "normal"...

applicationShouldTerminate: and cleanup during app termination

I'm looking are some CrashReporter logs for my Cocoa/MacOSX application and it looks like the reason for the crash is that some cleanup I expect to perform in the [applicationShouldTerminate:] method of the NSApplicationDelete isn't being performed. However, the app is terminating as evidenced by the following trace: 1 libSystem.B.dyl...

How to reduce the duration of an implicit animation to 0 for a CAReplicatorLayer

I've got a CAReplicatorLayer replicating its sublayer as per expected, but there's a built-in duration to the animation that I want to turn off. In other words I want to see the instantaneous results of replicating the base layer, rather than over the time duration that's implicitly specified by Apple. Here's the replication code, brack...

why the tableview doesn't show binding data?

Here's my code of generating data - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application [array initWithCapacity:20]; } - (IBAction) readlog:(id)sender { for (int i = 0; i < 20; i++) { NSDictionary *d = [NSDictionary dictionaryWithContentsOfF...

QTMovie backed by a Movie works initially, but not in another method

What follows is an initializer method. It creates a Movie structure from a file, with an eye to extracting the raw pixels for processing, as per Apple QA1443. This is then wrapped in a QTMovie – sourceMovie = [QTMovie movieWithQuickTimeMovie: ...] – for convenience. After initializing such an object, the second method is called, and we ...

Determine if the east coast is currently using EST or EDT via iPhone SDK

How can I determine if the east coast is currently using EST or EDT using the iPhone SDK? I am aware of the NSTimeZone class and I attempted the following but it did not work, the result is "East coast is NOT on DT" which it currently is. This leads me to believe that isDayLightSavingTime simply checks whether its being passed an ST or ...

Need clarification on addObjectsFromArray function

I have the following code (both items and itemsCopy are NSMutableArray's): //DO: populate items w/ 30 elements [self.itemsCopy addObjectsFromArray:self.items]; //DO: remove all elements in items Results Begin Pass 1: itemsCopy = 0 items = 30 End Pass 1: itemsCopy = 30 items = 0 Begin Pass 2: itemsCopy = 0 items = 30 End Pass 2: it...

what is the difference among sleep() , usleep() & [NSThread sleepForTimeInterval:] ?

Hi all, Can any body explain me what is the difference among sleep() , usleep() & [NSThread sleepForTimeInterval:] ? What is the best condition to use these methods ? ...

Animate between two states of a view, using custom animation

Hi, I would like to animate between two states of a view. Say, for example, I have a view with a label and when I change the text of the label an animation renders that change as a page flipping. Now you can of course do this with a [UIView setAnimationTransition:forView:cache:]: - (IBAction)nextPage { [UIView beginAnimation:nil...

How to handle setDelegate: when using multipe threads

Hi all, I've come across an issue with using a third party library, and am not sure what the common pattern to solve it is. I'm using the asi-http-request class, which fetches http objects asynchronously using a thread. In my objects dealloc() method, I do [request setDelegate:nil]; [request release]; However the delegate is someti...