cocoa-touch

Implementing incremental search on iphone

I have alot of data stored locally (10000+ data records) (not decided on how yet - this is part of the question) How may I implement incremental search on this data (on a specific field)? How should I set up the data locally? XML? plist? sqlite? Should I use Core Data for access? ...

dynamically creating variable names in objective-c

hey all, i'm in a bit of a situation here... i am passing a string to a function and in that function i need to create an array whose name is the value of the string. Say, for example: -(void) function : (NSString *) arrayName; //let arrayName = @"foo"; In this function I need to create an array named "foo" i.e the value of the passed pa...

How can I give "+123" to an NSNumberFormatter and not get a "NaN' back ?

I have set up a nice NSNumberFormatter which does all the things I want, except allowing a number to be preceded by a unary "+". It's not a common usage normally, but I'm entering latitudes and "+12.34" is sometimes used to indicate a northern latitude in the same way "-43.21" indicates southern. Likewise for longitudes and East/West. ...

What am I doing wrong with NSManagedObjectContext dependency injection?

I am trying to use NSManagedObjectContext dependency injection as recommended by Marcus Zarra -- I'm creating an M.O.C. in my AppDelegate and passing it as a retained property to each of my view controllers. Generally this seems to work well, but in a modal table view controller that presents data via an NSFetchedResultsController, I on...

how to extract 64 bit signed integer value

I'm querying a NSDictionary for a value. Because I got problems I printed the object. It shows me the following: <CFString 0x5d33630 [0x26af380]>{contents = "myDictionaryItem"} = <CFNumber 0x5d58940 [0x26af380]>{value = +1286301600, type = kCFNumberSInt64Type} So it is of type signed 64 bit integer. So I tried to extract the value like...

distribute library for iphone development

hey! I have created a project in xcode which creates a ".a" file. fine, this works! but now I want to give this .a file to another company, who have to develop with this classes. when I'm create a new project and add the .a file in the new project, no files could be found. for example: when I link to the "XRActionView.h" file or so (whi...

check if NSNumber is empty

How do I check if a NSNumber object is nil or empty? OK nil is easy: NSNumber *myNumber; if (myNumber == nil) doSomething But if the object has been created, but there is no value in it because an assignment failed, how can I check this? Use something like this? if ([myNumber intValue]==0) doSomething Is there a general met...

Overridden UIPickerView instantiated on simulator but not on device.

Hello all. In my project I have a subclass A of a UIPickerView. In Interface Builder I have a UIPickerView whose type I have changed to my subclass A. In another class B, also defined in my code, instantiated in Interface Builder and linked to A via its outlet, it refers to A with an IBOutlet field A *mySubclass. The problem is this: W...

how to load an html file locally into the uiwebview

i am having problem with how to get the uiwebview loaded with local html file .provide the cod e as well i am having the hmtl file as fp_dis-1.html. thanks in advance ...

Can't put a NSString into a NSMutableArray and store it in NSUserDefaults

new problem: I am receiving this error: '-[__NSCFArray insertObject:atIndex:]: mutating method sent to immutable object' In the ViewDidLoad I initialized my array: id object = [[NSUserDefaults standardUserDefaults] objectForKey:@"array"]; if (object) { locationArray = object; NSLog(@"retrieved", object); ...

Will my app get rejected if I place an iAd in a UITableView headerView?

I am displaying iAd's in the headerView of a UITableView. When the user scrolls the iAd disappears because the headerView is no longer visible. I am not sure if this will prevent my app from being accepted. ...

Odd behavior when showing UIPopoverController

Hello, In my iPad app, I save the state (visible/not visible) of a popover. So, during the launch of the app I initialize the UIPopoverController and tell it to show itself by using presentPopoverFromBarButtonItem:permittedArrowDirections:animated:. For the first argument (UIBarButtonItem), I use self.navigationItem.rightBarButtonItem. ...

Programatically remove selection in UIWebView

Is there a way to programatically remove the selection box of text which the user has selection in a UIWebView? ...

Navigation Controller that doesn't use the whole screen

I have a navigation controller which I don't want to use up the whole screen. In particular, I want to put a logo image in a bar at the top of the screen. Unfortunately, the navigation controller doesn't seem to be designed this way. In interface builder, I can't make it take up part of a screen. How would you achieve the effect of a log...

how can I access control of different pages in UIScrollView ?

I have a horizontal UIScrollView. It have 3 pages. It I have 3 UIButtons on each page of the scrollview. Total of 9 UIButtons. I need to set a different color when a button is touched, so that I can differentiate that touched button with the other buttons. I tried setColor by checking BOOL values. It is working for single page. When I ...

Is it possible programatically to get the iPhone Name order preference?

In my iPhone app, I display a list of names. I want the name to be formatted either as ("First Name" "Last Name") or as ("Last Name, "First Name") Is it possible to know the users' contact app preference using a API? ...

Calibrating code to iphone acellerometer and gyro data

I'm concepting an iPhone app that will require precise calibration to the iPhones accelerometer and gyro data. I will have to simulate specific movements that I would eventually like to execute code. (Think shake-to-shuffle, or undo). Is there a good way of doing this already? or something you can come up with? Perhaps some way to gene...

NSDate for first day of the month

This is quite a simple concept, but as of yet I have been unable to find an elegant (and calendar locale independent) solution. I need to find the first day of the month for an arbitrary NSDate. For example, given an arbitrary NSDate (arbitraryDate) another NSDate object will be returned (let's call this firstDayOfMonthDate) which repres...

Disallow UIScrollView from catching subviews touches

I've got a UIScrollView covered with a custom UIView which desperatly needs to listen to all the touch events that happen inside of him. At first, all I was getting was touchesBegan: and touchesCancelled: events. No touchesMoved:, no touchesEnded:. In fact, all the dragging gestures where being canceled by the above UIScrollView. This w...

Do I need to release the context returned from UIGraphicsGetCurrentContext()?

I am using CGContextRef. UIGraphicsBeginImageContext(self.drawImage.frame.size); CGContextRef context=UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(context,0.0f,0.0f,0.0f,1.0f); UIGraphicsEndImageContext(); CGContextRelease(context); Do I need to call CGContextRelease(Context); in the above one. ...