cocoa-touch

table view :: could not delete the custom label in custom cell

时光总嘲笑我的痴心妄想 提交于 2019-12-25 01:33:18
问题 In my iPhone app, In Table view I have Two labels in one cell.. textLabel which is default. Custom Label Data is deleting from array which is fine... Here is the code.. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //Get the Log Id for the sections. From Section Array int logID=0; if(indexPath.row==0) { NSLog(@"Time Array %@",timeArray); logID=[[[sectionArray objectAtIndex:indexPath.section] valueForKey:@"logID"] intValue];

Controlling changes in the navigation stack

白昼怎懂夜的黑 提交于 2019-12-25 01:32:59
问题 I want to be able to check for specific conditions when a user selects the "back" button from a navigation controller - then display an alert and stop the pop up the navigation stack from occurring. I can get notified in the viewWillDissappear method that the pop is about to occur - but is there a mechanism to stop the pop from happening? 回答1: You can try subclassing UINavigationController and then override the popViewController method to include your logic. - (UIViewController *

didSelectRowAtIndexPath not working on sdk 3.0

為{幸葍}努か 提交于 2019-12-25 01:26:02
问题 I was working on an app in SDK 2.x and everything was working fine, but now I have updated my SDK to 3.0 and found: didSelectRowAtIndexPath of tableview is not working. Anyone know why this is happening? 回答1: The Table View Programming Guide says: "You can control whether rows are selectable when the table view is in editing mode by setting the allowsSelectionDuringEditing property of UITableView. In addition, beginning with iPhone OS 3.0, you can control whether cells are selectable when

How to add Button in UINavigationController

戏子无情 提交于 2019-12-25 01:24:58
问题 navigator=[[UINavigationController alloc]initWithRootViewController:contacts]; UIBarButtonItem *nextButton = [[UIBarButtonItem alloc] initWithTitle:@"Delete" style:UIBarButtonItemStyleBordered target:self action:@selector(makeCall)]; //[[self.navigator navigationItem] setLeftBarButtonItem:nextButton]; self.navigator.navigationBar.items=[NSArray arrayWithObject:nextButton]; I am adding a button to UINavigationController and got following exception please help me 2011-01-03 11:46:26.626

Can I get default audio files of Iphone (marimba, alarm, ascending,…)?

我是研究僧i 提交于 2019-12-25 01:24:07
问题 Currently I am working on iPad. I would like to retrieve system audio files by default in iPad (I think it is the same in iPhone). Does anyone know how to retrieve it? I have tried AudioServicesCreateSystemSoundID or AVAudioPlayer but I can get these audio files (Marimba, alarm or ascending,...) Thank you 回答1: If you can SSH into your device (or root it in any way) you can go to "/System/Library/Audio/UISounds" and they are the audio files are located there. Of course this would mean that you

How can I correctly change the way a UITabBar appears using the appearance proxy?

余生长醉 提交于 2019-12-25 01:15:43
问题 Since I am developing an iOS >= 5.0 application, I am trying to change the appearance of the main UI components through the appearance proxies. When dealing with the UITabBar component, I correctly changed its tintColor to a light shade of gray trough the [[UITabBar appearance] setTintColor:] method. But doing this, the UITabBarItem s included in the bar are quite impossible to see, since they retain the old gray/white color in their title label. I tried to change their appearance through the

Can't enable Parse Local Datastore

廉价感情. 提交于 2019-12-25 01:13:53
问题 I'm trying enable the Parse Local Datastore. In the Parse Docs, they said to put the code enableLocalDatastore before setApplicationId:clientKey: , but this throws an exception: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'You have to call setApplicationId:clientKey: on Parse to configure Parse.' 回答1: v1.6.0 Place the code for enableLocalDatastore after setting applicationId and clientKey. It looks like it was simply a mistake in their documentation.

Run the code on program start-up

谁说胖子不能爱 提交于 2019-12-25 01:12:12
问题 I’m using [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.google.com"]]; to open Safari and redirect to a URL. Where can I put this code in so as to let the program run this code at start-up? At the beginning, I have the file of "HelloWorldViewController.h", "HelloWorldViewController.m" and "HelloWorldViewController.xlb" that are generated by XCode 4. Updated, I added the code as below to xxxx.m file, but not works, please help - (BOOL)application:(UIApplication *

viewDidAppear & viewWillAppear not firing in tabbar app

喜夏-厌秋 提交于 2019-12-25 00:39:21
问题 In a tab bar application, I'm adding a view to my first tabbar view by doing: [self.view addSubview:anotherView.view]; Once anotherView is done, I do: [self.view removeFromSuperview]; Which goes back to the parent but doesn't fire viewDidAppear or viewWillAppear on the parent. I can use messaging but it seems there must be a better way. Any suggestions? 回答1: When you add a subview to the first view, it's still visible, just behind the second view. Those methods don't fire because technically

How to access one UIViewControllers properties from another UIViewController?

爷,独闯天下 提交于 2019-12-25 00:33:25
问题 I have one single MainViewController which has of course it's one main UIView. I have this main view comprised of many different subviews. Some of these subviews have their very own ViewController. Lets say the MAIN view (whose delegate is primarily MainViewController) has a container which loads another UIView that uses a separate UIViewController- SecondaryViewController as the delegate for most it's actions. This container view is of course loaded in MainViewController via