cocoa-touch,uialertview,timingRelated issues-Collection of common programming errors
CoDEFRo
ios iphone cocoa-touch core-data
I am using NSFetchedResultsController to load some data into UITableView. No matter how many objects I save, it only loads the first one. If I delete that one object from the UITableView and reload it, sometimes it will show one or more of the other objects I’ve saved. It’s very unpredictable. The strange thing is the code I was using worked fine on the iOS6 SDK. I know that the issue is with the NSFetchedResultsController because when I make a fetch request with NSFetchRequest, the data that is
Bavarious
iphone objective-c cocoa-touch uiscrollview
I have a scrollView and inside it some scrollViews , and everyone have a webview to show html file, using this method I will zooming every html file , but Now I found that when I scroll the html file it didn’t work. I think I scroll the scrollview inside and it autosize the html file , but How to let the scrollview inside not to call the scroll function and when I scroll the html it can call the scroll function outside, and I have disable the scroll property of inside scrollview, but it didn’t w
Brad Larson
iphone cocoa-touch uiwebview
How can I place a UIWebView in a table view cell, yet maintain the UIWebView’s scrollbars? My table view does have multiple cells and a header frame as well, and I do need it to be scrollable because it has many rows.The text displays perfectly fine when I use UITextView and it shows scrollers as well, but the problem is that my content is rich text, so I don’t have any other option but to show the content in UIWebView. Any ideas, hacks?
Mrwolfy
cocoa-touch uiview cgaffinetransform
I am trying to simply animate a view from one position to a another, using the code below, but the animation is not smooth. There is a “pop” in the animation. It moves up quickly before moving down for example.Can anyone let me know if there is something wrong with my setup?[UIView animateWithDuration:0.2 animations:^{[_label setTransform:CGAffineTransformMake(1, 0, 0, 1, 0, 88)];transformState = 1;}];Thanks for reading!If you have a minute please download this very simple test project, so you c
SpacyRicochet
iphone cocoa-touch avfoundation avplayer live-streaming
I’m trying to create a more generic media controller for several types of streaming media and want to adapt the UI to the type of stream;When it’s an on-demand file stream (i.e. a single MP3 file that’s being streamed), you should be able to seek forward and backward. Thus, the seek slider should be visible. When it’s a live stream, it isn’t possible to seek forward and backward, and thus the seek slider should be hidden.Is there any way to determine from the AVPlayer (or perhaps the AVPlayerIte
mklement0
iphone cocoa-touch ios uibarbuttonitem uitoolbar
I wonder if anyone else has noticed this behavior – searching the web or these forums didn’t unearth anything for me:[Update: issue still exists on iPhones (but not iPads) as of iOS 7.0.1]In an iPhone app on iOS 4.2.1, down to at least 3.2 (in the Simulator), if you – have a toolbar (UIToolBar – whether explicitly created or provided by a UINavigationController) filled with UIBarButtonItem instances of style UIBarButtonItemStyleBordered (rectangular buttons with rounded borders) – and you have c
bioffe
iphone objective-c cocoa-touch uikit
Why does the following code works:[signInBtn setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted]; [signInBtn setTitleColor:[UIColor blackColor] forState:UIControlStateDisabled];while this does not:[signInBtn setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted|UIControlStateDisabled];
Nikolai Ruhe
iphone cocoa-touch uitableviewcell
Within tableView:cellForRowAtIndexPath:// Make a cell: UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@”Default”] autorelease];// Make a spinner: UIActivityIndicatorView *spin = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; // [spin retainCount] = 1// Start spinning [spin startAnimating];[cell.contentView insertSubview:spin atIndex:0]; // [spin retainCount] = 3. Huh? // I would have expected it t
An1Ba7
iphone objective-c ios xcode cocoa-touch
I am using XCode Version 3.2.5. I am developing an application where if I build the application on the device, I get the following warningld: warning: unexpected srelocation type 9I have followed the steps given in the following linkunexpected srelocation type 9I have tried to follow all the step in the one where we have to set the following code in the info.plist file<key>UIRequiredDeviceCapabilities</key> <array> <string>armv6</string> <string>armv7</stri
Thomas K
iphone cocoa-touch uitableview accessoryview
I’ve got a UITableView containing three sections. Section 1 has one cell containing a UISwitch failAtLaunch in its accesoryview Section 2 contains the items from the failSounds array and has a singular checkmark for the selected item (sound in this case) Section 3 contains a button.You can see below how I configure the cells..The problem is that the table gives strange behaviour. Whenever I scroll up and down the tableview, with cells moving in and out of view, some cells in section 2 get the UI
iPatel
iphone ios objective-c uialertview
I’m popping up a UIAlertView with a UITextField in it. I want the text field to auto-capitalize all words. I’m doing this by setting properties of the text field, but they have no effect at runtime. Here’s my code:UIAlertView* alert = [[UIAlertView alloc] initWithTitle: titlemessage: messagedelegate: selfcancelButtonTitle: @”Cancel”otherButtonTitles: @”Create”, nil]; alert.alertViewStyle = UIAlertViewStylePlainTextInput; UITextField* titleField = [alert textFieldAtIndex: 0]; titleField.autocapit
nielsbot
objective-c modal-dialog uialertview objective-c-blocks wait
I’m having a lot of trouble trying to get my Objective-C code to wait appropriately for user input from a UIAlertView before triggering subsequent code. For example, I have the following code:if (!self.currentUser) [self displayLoginUIAlertView]; Program *program = [[Program alloc] initWithUser:self.currentUser]; [program startProgram];Where Program is a custom object and where user input from [self displayLoginUIAlertView] sets the property self.currentUser.I would prefer not to put the second
Nathan
iphone ios cocoa-touch uialertview
-(IBAction)showCountryInfo:(id)sender { @try {CountryProperties *countryProperties=[self.storyboard instantiateViewControllerWithIdentifier:@”Culture”];countryProperties.countryID=self.countryID;countryProperties.modalTransitionStyle = UIModalTransitionStyleCoverVertical;[self.navigationController presentModalViewController:countryProperties animated:YES]; } @catch (NSException *exception) {UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@”Sorry” message:@”Module under revision” delegate:
Smiden
ios xcode uialertview nslocalizedstring localizable.strings
I’ve made a strings file named “Localizable.strings” and added two languages to it, like so:”CONNECTIONERROR” = “Check that you have a working internet connection.”; “CONNECTIONERRORTITLE” = “Network error”;I have also converted the files to Unicode UTF-8 However, when I create a UIAlertView like this:UIAlertView *myAlert = [[UIAlertView alloc]initWithTitle:NSLocalizedString(@”CONNECTIONERRORITLE”,nil)message:NSLocalizedString(@”CONNECTIONERROR”,nil) delegate:selfcancelButtonT
Oliver
iphone objective-c memory-management error-handling uialertview
When writing code, there are many situations that must be treated as runtime errors : an alloc/init returns nil, a resource is not found, a [someClass canDoThis] returns NO for an absolutely-needed feature where YES would be the natural answer, …For all these situations, I have written an exitWithMessage routine (that displays an alert box), and each class has a kill method that frees allocated memory.So… When in an init method, you have these kind of exceptions, I supposed you could do :[se
AJS
objective-c uitableview uialertview
I want to delete a row from a tableview with a confirmation alertview. I have shown an alert on the delete button action but on the action always crashing.Crash Log is:[__NSCFSet row]: unrecognized selector sent to instance 0x847c5902012-08-11 12:20:35.583 EZDistributor[895:15803] * Terminating appdue to uncaught exception ‘NSInvalidArgumentException’, reason:’-[__NSCFSet row]: unrecognized selector sent to instance 0x847c590’My code is given below:- (void)tableView:(UITableView *)tableView comm
Balakrishna
ios objective-c ipad uialertview
I need to show alert view while some code is executing in background. For this i have implemented the following code.//this is loading alert -(void)showAlert:(NSString *)message {// UIAlertView *alert; alert11 = [[UIAlertView alloc] initWithTitle:@”Updates” message:message delegate:self cancelButtonTitle:@”OK” otherButtonTitles: nil];#ifndef IOS5_1[alert11 autorelease];#endif[alert11 show];}-(void) showUpdates1:(NSString *)data { isUpdating = true; VideoBrowserAppDelegate *appDelegat
Magic Bullet Dave
iphone objective-c ios cocoa-touch uialertview
With this code, I get this error:’* -[NSMutableArray insertObject:atIndex:]: attempt to insert nilobject at 0’categories=[[NSMutableArray alloc] init ]; UIAlertView* dialog = [[UIAlertView alloc] init];[dialog setDelegate:self];[dialog setTitle:@”Category name”];[dialog setMessage:@” “];[dialog addButtonWithTitle:@”Cancel”];[dialog addButtonWithTitle:@”OK”];nameField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)];[nameField setBackgroundColor:[UIColor whiteColor]];[dia
Sabby
iphone uialertview
Hi everyone I was using the below code to give a custom color to the UIAlertView.I was using S.D.K. 3.2.3 and the color was changing to the desired color.But today I updated my S.D.K. now I am using 4.2.1 and also run this code on this S.D.K. it worked.But when I checked again the color of the AlertView didn’t change ,but the color which i provided with image,moved to the backward of the alertview.I don’t know why this happening. Is there anything wrong that i doesn’t work with ios 4.2. Just let
mbh
iphone objective-c xcode core-data uialertview
So this is related to core data exceptions. I know it is very unlikely, but if it occurs, and I cannot recover from the error, I want to call abort();However, before calling abort I want to show a message likeThere is an unrecoverable error. The app is going to shut down.How do I achieve that? Using alertView does not work, as the abort() is called before the app gets a chance to display the message. Also at this point I want to block the thread from further execution of any code. It is almost l
Frank Dejay
fpga verilog timing
I’ve got a question about something I don’t understand that is going on in my FPGA project. I need to control two devices (AGC and ADC) through an SPI bus. As as the FPGA will be the master device, I’m generating a clock signal, SCK, in code by dividing the system clock. I then rout that signal to an output wire through a tristate buffer. Below is my relevant bit of code. It’s not shown, but the signal that controls the tristate buffer, en_SCK controlled by a FSM, when it is set low in the
altCognito
performance junit capture timing
I’d like to capture the timings from my jUnit tests into some format that I can pull into excel or csv. Is there a tool or even a simple way to do this through injection to do this?I’ve seen jUnitPerf, but this does not include any output, and also requires code to create sets of tests, which is far more elaborate than I am thinking.(investigated the following questions without finding the answer)JUnit test timing in Eclipse Capturing timing data from Junit tests on Eclipse
Superbest
c# performance datetime timing stopwatch
This question already has an answer here:Is DateTime.Now the best way to measure a functions performance?13 answersI wanted to track the performance of my code so I stored the start and end time using System.DateTime.Now. I took the difference between the two as the time my code to execute. I noticed though that the difference didn’t appear to be accurate. So I tried using a Stopwatch object. This turned out to be much, much more accurate.Can anyone tell me why Stopwatch would be more accurate t
user1562347
c cuda timing
I’m currently doing two implementations of an algorithm, one in C and the other in CUDA, and am planning to do a comparison between the two in terms of runtime. My question is, what would be the best C timer to use considering I’m going to be comparing runtimes in C and CUDA. For CUDA, I shall be using Events, and I’ve read about wall clock timers in C such as clock() and gettimeofday() as well as high-resolution timers such as clock_gettime(), but am unsure which C one to use if I’m going to be
brandoko
java testing arraylist big-o timing
My partner and I are attempting to program a LinkedList data structure. We have completed the data structure, and it functions properly with all required methods. We are required to perform a comparative test of the runtimes of our addFirst() method in our LinkedList class vs. the add(0, item) method of Java’s ArrayList structure. The expected complexity of the addFirst() method for our LinkedList data structure is O(1) constant. This held true in our test. In timing the ArrayList add() metho
theotherlight
php debugging methods timing
I was looking for a reliable, clean way to do advanced runtime reports for specific portions of a PHP script. What I’d love to do is dynamically time and track every method call of every object during script execution, log this information, and create a table/report at the end of the script for output.I’ve thought about doing something along the lines of, in pseudocode:class MagicTimingClass redefines *ALL_CLASSES* {public function __call($name, $args) {log_start_time();$return = run_the_method(
Keshav Saharia
algorithm summation timing
Background of my questionI discovered Project Euler today, and decided I would work through the problems in Mathematica. I became obsessed with the first problem, which is essentially “sum all the numbers from 0 to n that are multiples of 3 or 5”. I came up with several interesting solutions, and decided I would compare their runtimes to see if there is a way to optimize this calculation. While amusing myself with ListPlot’s of runtimes, I noticed some very interesting behavior in my solution th
Flexo
java c++ algorithm timing
Is is possible to create a program that, say with byte code, runs your program as normal, keeping a tally of the total run-time by using defined run-times of each instruction as you go? Then, once your program finished, you’d have an exact, system independent value for the run-time, without the need of running your program over and over and averaging the results, or finding the min. Sure the relation between this and actual run-time differs depending on excessive quantities of variables, but it
MPelletier
vb.net timing
I made a program that opens an application, sleeps the thread for 500ms then takes a picture of the frame’s handle. I do this to about 600 files. Oddly enough, every 40 or so files, the process.kill() doesnt work or something, because the application hangs, and the running files program is running, when it should have been killed, then my program crashes when it tries to start the process. On my slow laptop, it crashes every 60 or so, on my fast quadro, every 30 or so. What could cause this? I
flohei
cocoa-touch uialertview timing
I’m having a problem where all the UIAlertViews in my app take quite some time to show up. The display dims instantly but the actual alert needs like 5 seconds to be displayed.I’m creating them like this:UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@”Title”message:@”Message”delegate:nil cancelButtonTitle:@”OK” otherButtonTitles:nil]; [alertView show]; [alertView release];Anyone ever had this?Thanks -f
Web site is in building