Skip to main content

Posts

Resetting UISearchbar programmatically

Is there a possibility to reset a UISearchbar with searchDisplayController programmatically which is active and already contains text? - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (tableView == self.searchDisplayController.searchResultsTableView) { searchDisplayController.searchResultsTableView.hidden = YES; searchBar.showsCancelButton = NO; [searchBar resignFirstResponder]; } } This solution is working, but there is still text in the searchBar. If i add those lines of code: searchBar.text = @""; There is always a black transparent view left. Any solutions?

i WANT to use sharekit to share images from my NSMutablearray [closed]

I am using sharekit to share images, and want to be able to share all the images upon users request not just one image I am using sharekit to share images, and want to be able to share all the images upon users request not just one image // this is the code I have for my share button UIImage *image = [UIImage imageNamed:@"Atoms"]; SHKItem *item = [SHKItem image:image title:@"Look at this picture!"]; // Make the ShareKit action sheet SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; // Display the action sheet [actionSheet showInView:self.view]; // this is my array I want it my sharekit will respond to all the items in the array NSMutableArray *images = [[NSMutableArray alloc] initWithObjects:@"Americans.png",@"Approach.png",@"Arianny.png",@"Atoms.png",nil];

ShareKit Facebook authorization looping

I set up ShareKit for iOS 4.3 using the instructions found here. I implemented the method to call the ActionSheet(see the code below). The Twitter method works correctly, Your asked to authorize the app to tweet on your behalf then your redirect to a view to post the tweet. - (void)myButtonHandlerAction { SHKItem *item = [SHKItem text:@"ShareKit is Awesome!"]; // Get the ShareKit action sheet SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; // ShareKit detects top view controller (the one intended to present ShareKit UI) automatically, // but sometimes it may not find one. To be safe, set it explicitly [SHK setRootViewController:self]; // Display the action sheet [actionSheet showFromToolbar:self.navigationController.toolbar]; } However when I click the Facebook method takes you to authourize the app but when you return to the app it never shows a post dialog. Am I missing a step?

What triggers iOS 5.0 cache purge?

As of iOS 5.0 Apple began to purge or clean the Caches directory inside individual applications when it decided the device was using too much space. Can anyone point me to the location of documentation or anecdotal information regarding at which threshold this cache cleaning occurs (for instance 90%+ disk usage) and how often it is checked?

iPhone: Notification Center Trouble

I wrote an app that allows the user to enter data in a UITextField, and one of them allows them to enter in a specific date. I'm trying to have an alert appear in the iPhones Notification Center when the date is 15 hours away, even when the app is not running at all. EDIT: New code- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UILocalNotification *localNotif = [[UILocalNotification alloc] init]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"MMdd"]; NSDate *eventDate=[dateFormatter dateFromString:eventDateField.text]; localNotif.fireDate = [eventDate dateByAddingTimeInterval:-15*60*60]; localNotif.timeZone = [NSTimeZone defaultTimeZone]; localNotif.alertBody = @"Event Tomorrow!"; localNotif.alertAction = @"Show me"; localNotif.soundName = UILocalNotificationDefaultSoundName; localNotif.applicationIconBadgeNumber = 0; [[UIApplication

Subclassing UISearchDisplayController For Abstraction

I have multiple UIViewController that have table views. I want these VCs to just handle UI stuff as they will all search the same database. I want to subclass UISearchDisplayController so I can have this subclass handle all the data and search stuff. The VC I am working with is a UIViewController with a UITableView and a UISearchDisplayController . I have it set and can check to display the initial, or the searched data into the table view by using if/else statements like: if (tableView == self.searchDisplayController.searchResultsTableView) % else... I want this custom subclass that I'm creating to handle the code that is executed in the self.searchDisplayController.searchResultsTableView statement so I can have some abstraction and can use this custom class with other VCs. Any ideas on how to continue with this? I think I need to override some methods in the UISearchDisplayController . EDIT: Actually I may be coming into this wrong. I have it stepup the way I l

What javascript event gets fired when ios safari gets called from another app

I'm working on a mobile website / iPhone app combination. Upon entering the mobile website, I prompt the user to 'go to the app', 'download the app', or 'use mobile website'. From various entry points to the mobile website, I'm mostly worried about verification emails and text messages, so the user will check email, follow the verification link, enter Safari, get prompted to 'go to the app' and the verification link is sent to the app for it to handle. Now in the same session, if the user gets another email regarding the app, the user will check email again, follow a different verification link to Safari, and I want the 'go to the app' to work the same with the new link. Some quirks are that upon entering the mobile website, the verification link is stored and the URL is switched to site.com/home. The iphone overlay is completely separate from the rest of the site and doesn't have access to the site's storage of the verifi