Search Results

Search found 19072 results on 763 pages for 'iphone sdk 4'.

Page 152/763 | < Previous Page | 148 149 150 151 152 153 154 155 156 157 158 159  | Next Page >

  • Why is no video showing using MPMoviePlayerController

    - by nathanjosiah
    MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@"http://feeds.harvest.org/~r/greglaurietv/~5/MW4zfyeubC8/HD100307-iPod.mp4"]]; moviePlayer.scalingMode = MPMovieScalingModeNone; moviePlayer.controlStyle = MPMovieControlStyleDefault; [moviePlayer play]; only audio is playing, but nothing shows up in my view.... what am i doing wrong?

    Read the article

  • Using UIScreen to drive a VGA display - doesn't seem to show the UIWindow?

    - by Peter Hajas
    HI there, I'm trying to use UIScreen to drive a separate screen with the VGA dongle on my iPad. Here's what I've got in my root view controller's viewDidLoad: //Code to detect if an external display is connected to the iPad. NSLog(@"Number of screens: %d", [[UIScreen screens]count]); //Now, if there's an external screen, we need to find its modes, itereate through them and find the highest one. Once we have that mode, break out, and set the UIWindow. if([[UIScreen screens]count] > 1) //if there are more than 1 screens connected to the device { CGSize max; UIScreenMode *maxScreenMode; for(int i = 0; i < [[[[UIScreen screens] objectAtIndex:1] availableModes]count]; i++) { UIScreenMode *current = [[[[UIScreen screens]objectAtIndex:1]availableModes]objectAtIndex:i]; if(current.size.width > max.width); { max = current.size; maxScreenMode = current; } } //Now we have the highest mode. Turn the external display to use that mode. UIScreen *external = [[UIScreen screens] objectAtIndex:1]; external.currentMode = maxScreenMode; //Boom! Now the external display is set to the proper mode. We need to now set the screen of a new UIWindow to the external screen external_disp = [externalDisplay alloc]; external_disp.drawImage = drawViewController.drawImage; UIWindow *newwindow = [UIWindow alloc]; [newwindow addSubview:external_disp.view]; newwindow.screen = external; }

    Read the article

  • How to release MPMoviePlayerController?

    - by 4thSpace
    I have a couple of views that access the movie player. I've put the following code in a method in AppDelegate for these views. They send in the filename to play. The code works fine but I know a release is required somewhere. If I add the last line as a release or autorelease, the app will crash once the user presses done on the movieplayer. MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:moviePath]]; moviePlayer.movieControlMode = MPMovieControlModeDefault; [moviePlayer play]; //[moviePlayer release]; I get this error: objc[51051]: FREED(id): message videoViewController sent to freed object=0x1069b30 Program received signal: “EXC_BAD_INSTRUCTION”. How should I be releasing the player?

    Read the article

  • autoscrolling for UIScrollView

    - by thndrkiss
    Hi, I used the setContentOffset method to scroll to a particular point automatically without user interaction. [menuScrollView setContentOffset:CGPointMake(600.0,0) animated:YES] but when i try to call the same method in a looping fashion inorder to slow down the speed of scrolling the scrolling never happens for (int i = 1; i<=30; i++) { [menuScrollView setContentOffset:CGPointMake(600.0-i*10,0.0) animated:YES]; NSLog(@"%f",600.0-i*10); } During the above piece of code the scrolling of UIScrollview happens only once (1st iteration( and it does not scroll for remaining 29 interations. What is the problem here ?

    Read the article

  • UITableViewCell with UITableViewCellStyleValue1, adding new line to detailTextLabel at cell at botto

    - by slim
    on my tableview i have the last cell that is not initially visible as seen in the first image, when i scroll the list up, you can see in the second image that the price or my detailTextLabel is put on a new line not maintaining the right justification. Here is the code, i can't figure out why its doing this, any direction or help would be much appreciated - (UITableViewCell *)tableView:(UITableView *)ltableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [ltableView dequeueReusableCellWithIdentifier:CellIdentifier]; // Configure the cell. NSUInteger indexRow = [indexPath row]; switch (indexRow) { case 0:{ NSCharacterSet *set = [NSCharacterSet whitespaceCharacterSet]; NSString *description = [[currentData objectForKey:@"Description"] stringByTrimmingCharactersInSet:set]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; } cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.accessoryType = UITableViewCellAccessoryNone; cellShift = 1; if (![description isEqualToString:@""]) { cell.textLabel.text = @""; cell.detailTextLabel.text = description; cell.detailTextLabel.numberOfLines = 2; } else { cell.textLabel.text = @""; cell.detailTextLabel.text = @""; cell.detailTextLabel.numberOfLines = 0; } break; } default:{ if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease]; } NSDictionary *item = [tableData objectAtIndex:(indexRow-cellShift)]; NSString *name = [item objectForKey:@"Name"]; if ([name length] > MaxVendorsLength ) { name = [NSString stringWithFormat:@"%@ ...",[name substringToIndex:MaxVendorsLength]]; } cell.textLabel.text = name; cell.textLabel.minimumFontSize = 12; NSString *priceString; float price = [[item objectForKey:@"Price"] floatValue]; //NSLog(@"| %@ | : | %@ |",[item objectForKey:@"Name"], [item objectForKey:@"Price"]); if (price != 0) { priceString = [[NSString alloc] initWithFormat:@"$%.2f",price]; } else { priceString = [[NSString alloc] initWithString:@"--"]; } cell.detailTextLabel.text = priceString; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; [priceString release]; break; } } cell.textLabel.font = [UIFont boldSystemFontOfSize:15]; cell.textLabel.minimumFontSize = 14; cell.detailTextLabel.font = [UIFont boldSystemFontOfSize:15]; cell.detailTextLabel.minimumFontSize = 14; return cell; } Let me know if i need to post anything else to get help with this ???

    Read the article

  • "wait_fences: failed to receive reply: 10004003"?

    - by Michael
    I get this cryptic error the first time (and only the first time) my view is loaded due to the following line of code: - (void)viewWillAppear:(BOOL)animated { [textField becomeFirstResponder]; } There is a noticeable (~3 – 4 second, even on the simulator) delay due to this that makes my app feel unresponsive. Does anyone know how to fix this? I can't find any documentation on it on Apple's site, or any solutions here or on Google. Strangely, the opposite situation happens if I put the line in -viewDidAppear: instead of -viewWillAppear:; that is, instead of printing the error only the first time the keyboard is shown and never again, the error is not printed the first time but every time after. This is causing a major headache for me.

    Read the article

  • UITableViewCell no userInteraction but on cell.accessoryView

    - by Simon
    hello genius and nerds I have a TableViewCell with a UISwitch in accessoryView. I don't want that blue background if someone selected it. There fore i used cell.userInteractionEnabled = NO; but then the whole cell isnt accessable so i tried that cell.userInteractionEnabled = NO; cell.accessoryView.userInteractionEnabled = YES; i think this wont work because cell is the parent of the accessoryView. but how can i manage this issue ? A hint in the right direction would be great. Simon Here is the complete cellForRowAtIndexPath method: cell.textLabel.text = @"dasda"; cell.userInteractionEnabled = NO; cell.accessoryType = UITableViewCellAccessoryNone; UISwitch *mySwitch = [[[UISwitch alloc] initWithFrame:CGRectZero] autorelease]; mySwitch.tag = row; [cell addSubview:mySwitch]; cell.accessoryView = mySwitch; cell.accessoryView.userInteractionEnabled = YES; [(UISwitch *)cell.accessoryView setOn: YES]; [(UISwitch *)cell.accessoryView addTarget:self action:@selector(someAction:) forControlEvents:UIControlEventValueChanged]; return cell;

    Read the article

  • UIPickerVIew Multiple Component Pop-In

    - by harekam_taj
    Hello, I want to create a UIPickerView which will have 2 option to choose. The second option will be based of the first option selected. I want the UIPickerView to also popin on a button presses something similar to he calendar app to the date select. Can someone guide me to a article or where should I start? Thanks for all your help!

    Read the article

  • Data Formatters temporarily unavailable

    - by Zac Altman
    Im trying to use Date Formatters (UIDateFormatter), but I keep getting this error: Program received signal: “EXC_BAD_ACCESS”. Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib")

    Read the article

  • Stopping network activity indicator.

    - by iSharreth
    I used the below code to load a webpage. Everything works fine, but I want to stop the network activity indicator after completing loading the webpage. How can we know that the webpage is loaded completely. Anyone please help. UIApplication* app = [UIApplication sharedApplication]; app.networkActivityIndicatorVisible = YES; // to stop it, set this to NO NSURL *url = [NSURL URLWithString:@"http://www.google.com"]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webView loadRequest:request];

    Read the article

  • how secure is NSURLConnection over https

    - by drunken_elf
    I've been reading through a number of questions on this site regarding NSURLConnection and https, but most relate to "untrusted" certificates and how to allow them nonetheless. My question is a little more basic. I am building an app for a client who handle online donations, and I would like to load their donation script using an NSLURLRequest and POST the values of credit card details (entered in the app). Does NSURLConnection (when connecting to a https url) ensure the encryption of those details as they are sent to the donation script on my clients server? Sorry if this is a basic question, I just couldn't find a place in the apple docs that guaranteed this.

    Read the article

  • Passing touch events on to subviews

    - by Egil Jansson
    I have a view within a UIScrollView that loads an additional subview when the user presses a certain area. When this additional subview is visible, I want all touch events to be handled by this - and not by the scrollview. It seems like the first couple events are being handled by the subview, but then touchesCancelled is called and the scrollview takes over the touch detection. How can I make sure that the subview gets all the events as long as the movement activity is being performed on this view? This is my implementation on touchesMoved - which I thought would do the job... -(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[touches allObjects] objectAtIndex:0]; CGPoint touchPt = [touch locationInView:self]; UIView *hitView = [self hitTest:touchPt withEvent:event]; UIView *mySubView = subviewCtrl.view; if(hitView == mySubView) { [subviewCtrl.view touchesMoved:touches withEvent:event]; } else { NSLog(@"Outside of view..."); } }

    Read the article

  • MPMoviePlayerController fullscreen movie inside a UIWebView

    - by Wakazors
    Hi, I'm having a problem with the UIWebView and MPMoviePlayerController: My UIWebView have a movie inside the html (it's a local html file), I'm using html5 and a video tag for the video. The problem is: the user can set the video to play inline, directly on the html or he can tap the fullscreen button, but I need to know if the video is playing fullscreen. I've tried to use MPMoviePlayerDidEnterFullscreenNotification but with no success. Does anybody know how to get this notification from the webview? Thanks in advance

    Read the article

  • Custom UIView built with Interface Builder accessible/positionable via Interface Builder

    - by Nader
    This shouldn't be this confusing. I have a custom UIView with a bunch on controls on it. UILabels, buttons, etc. I've created this Nib using Interface Builder. I want to be able to position this custom uiview on another UIView using the interface builder. How do I link my UIView custom class, to the nib? initWithCoder gets called, but I want this class to get loaded from the nib. Thanks

    Read the article

  • Empty "Groups" in People Picker Navigation Controller

    - by Meltemi
    I'm using the standard People Picker Navigation Controller to let users associate one of their contacts with one of my objects. It presents itself as a long list of ALL contacts. The back button (top left) says "Groups" but when clicked on it shows an empty screen...even when there are many Groups in the user's address book. I've read through the docs and can't seem to find how to populate the Groups area. Here's how I present the people picker. Fairly standard: - (IBAction)showPicker:(id)sender { ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init]; picker.peoplePickerDelegate = self; [self presentModalViewController:picker animated:YES]; [picker release]; } What am I missing?

    Read the article

  • issues make a persistent object in Objective C

    - by oden
    Attempting to make a NSObject called 'Person' that will hold the login details for my application (nothing to fancy). The app is made of a navigation controller with multiple table views but I am having issues sharing the Person object around. Attempted to create a static object like this: + (Person *)sharedInstance { static Person *sharedInstance; @synchronized(self) { if(!sharedInstance) sharedInstance = [[Person alloc] init]; return sharedInstance; } return nil; } And here is the header // Person.h #import <Foundation/Foundation.h> @interface Person : NSObject { NSString *fullName; NSString *firstName; NSString *lastName; NSString *mobileNumber; NSString *userPassword; } @property(nonatomic, retain) NSString *fullName; @property(nonatomic, retain) NSString *firstName; @property(nonatomic, retain) NSString *lastName; @property(nonatomic, retain) NSString *mobileNumber; @property(nonatomic, retain) NSString *userPassword; + (Person *)sharedInstance; -(BOOL) setName:(NSString*) fname; -(BOOL) setMob:(NSString*) mnum; -(BOOL) setPass:(NSString*) pwd; @end This object setters and getters are needed in different parts of the application. I have been attempting to access them like this Person * ThePerson = [[Person alloc] init]; ThePerson = nil; NSString * PersonsName; PersonsName = [[Person sharedInstance] firstName]; Everything works well at the login screen but it dies at the next use. usually EXC_BAD_ACCESS (eek!). Clearly I am doing something very wrong here. Is there an easier way to share objects between different a number view controllers (both coded and xib)?

    Read the article

  • three20 linking error

    - by neha
    Hi all, After following all the instructions on http://three20.info/setup/existing to integrate three20 library into my project. I'm getting this linking error: duplicate symbol _TTCreateNonRetainingArray in /test Justmeans Photos App/Three20/Build/Products/Debug-iphonesimulator/libThree20Core.a(TTGlobalCore.o) and /test Justmeans Photos App/Three20/Build/Products/Debug-iphonesimulator/libThree20.a(TTGlobalCore.o) three20 static library Can anybody please help me make out this? Thanx in advance.

    Read the article

  • How to check if variable is a CFString?

    - by Sheehan Alam
    I am trying to set some text on a label descriptionLabel.text = [NSString stringWithFormat:mySTUser.bio]; The bio property of mySTUser is an NSString. Sometimes it is not an NSString when I set it. How can I check if mySTUser.bio is an NSString so I can prevent it from being assigned to my label text?

    Read the article

  • Search Display Controller Crashes When Returning Results

    - by Convolution
    I have a tableview with a search display controller. It has been working fine in the past, but recently has started crashing for certain search results. Here my code searches a Golfer based on their Name, Age and Handicap. The data is correctly loaded into the table, I can access and drill down to receive further information. However when I type in a search query for either Name or Age, the app crashes, while the Golfers Handicap is returned fine. Note: dataSouceArray is the data source for the tableview, dataSourceArrayCopy is the mutable copy of the data used to add and remove objects in the search filter. - (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope { /* Update the filtered array based on the search text and scope. */ [self.dataSourceArrayCopy removeAllObjects]; // First clear the filtered array. /* Search the main list for products whose type matches the scope (if selected) and whose name matches searchText; add items that match to the filtered array. */ for (Golfer *golfer in dataSourceArray) { if ([scope isEqualToString:@"Name"] || [golfer.golferName isEqualToString:scope]) { NSComparisonResult result = [golfer.golferName compare:searchText options:(NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch) range:NSMakeRange(0, [searchText length])]; if (result == NSOrderedSame) { [self.customerListCopy addObject:golfer]; } } if ([scope isEqualToString:@"Age"] || [golfer.golferAge isEqualToString:scope]) { NSComparisonResult result = [golfer.golferAge compare:searchText options:(NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch) range:NSMakeRange(0, [searchText length])]; if (result == NSOrderedSame) { [self.dataSourceArrayCopy addObject:golfer]; } } if ([scope isEqualToString:@"Handicap"] || [golfer.golferHandicap isEqualToString:scope]) { NSComparisonResult result = [golfer.golferHandicap compare:searchText options:(NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch) range:NSMakeRange(0, [searchText length])]; if (result == NSOrderedSame) { [self.dataSourceArrayCopy addObject:golfer]; } } } } - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString { [self filterContentForSearchText:searchString scope: [[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]]; // Return YES to cause the search result table view to be reloaded. return YES; } - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOption { [self filterContentForSearchText:[self.searchDisplayController.searchBar text] scope: [[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:searchOption]]; // Return YES to cause the search result table view to be reloaded. return YES; } Any help would be appreciated, thank you for taking the time to read this.

    Read the article

  • Setting a UITableViewCell accessory type on some cells, but not all

    - by Sheehan Alam
    I have 8 cells that are being built in my UITableViewController. I would like to know how I can show a disclosure indicator on the 4th and 8th cells. Right now I am building it in - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath though I am fully aware it is going to add a disclosure indicator to every cell cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

    Read the article

  • How to dismiss keyboard on a UIWebView?

    - by Sheehan Alam
    I am loading an HTML page that has a form. I would like to be able to dismiss the keyboard when the user clicks on GO or if he clicks on the SUBMIT button on the HTML page. If the user decides he doesn't want to fill out the form, I also need a way to dismiss the keyboard. Not sure how to do this.

    Read the article

  • Keyboard Animation Issues When Calling becomeFirstResponder within a Modal View Controller

    - by LucasTizma
    I've been having some issues with calling -becomeFirstResponder on a UITextField contained with a view controller that is presented modally. I call this method in the modal view controller's -viewDidLoad method so that the keyboard is immediately displayed. What I expected is for both the keyboard and the modal view controller to animate from up the bottom of the screen at the same time. However, what I'm observing is the following: There is a ~0.2 second UI lag between clicking the button that calls the -presentModalViewController:animated: method on the parent view controller and when the child view controller begins to animate modally. The keyboard is immediately presented with absolutely no animation about half-way through the modal view controller's animation. Once the modal view controller's animation is complete, everything else seems to operate smoothly. Dismissing the modal view controller results in it being smoothly animated off screen (along with the keyboard, coincidentally). It's as if the keyboard's animation and the modal view controller's animation are both competing for some lower-level Core Animation resource at the same time, but I don't see why this should be happening. What further seems to corroborate this hunch is if I don't ask the UITextField to become the first responder (i.e., if I don't ask the keyboard to present itself), then there is absolutely no UI lag, and the modal view controller animates instantly. Interestingly, if I do something like [self.textField performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0.0001]; then the animation of the keyboard happens nearly at the same time as the modal view controller's animation -- it's extremely difficult to tell that they aren't both being animated at the exact same time. Furthermore, there's no more UI lag. Has anyone experienced anything similar to this?

    Read the article

  • iPad: Move UIView with animation, then move it back

    - by Joel
    I have the following code in a UIView subclass that will move it off the screen with an animation: float currentX = xposition; //variables that store where the UIView is located float currentY = yposition; float targetX = -5.0f - self.width; float targetY = -5.0f - self.height; moveX = targetX - currentX; //stored as an instance variable so I can hang on to it and move it back moveY = targetY - currentY; [UIView beginAnimations:@"UIBase Hide" context:nil]; [UIView setAnimationDuration:duration]; self.transform = CGAffineTransformMakeTranslation(moveX,moveY); [UIView commitAnimations]; It works just great. I've changed targetX/Y to 0 to see if it does indeed move to the specified point, and it does. The problem is when I try and move the view back to where it was originally: moveX = -moveX; moveY = -moveY; [UIView beginAnimations:@"UIBase Show" context:nil]; [UIView setAnimationDuration:duration]; self.transform = CGAffineTransformMakeTranslation(moveX,moveY); [UIView commitAnimations]; This puts the UIView about 3x as far as it should. So the view usually gets put off the right side of the screen (depending on where it is). Is there something with the CGAffineTransforMakeTranslation function that I should know? I read the documentation, and from what I can tell, it should be doing what I'm expecting it to do. Anyone have a suggestion of how to fix this? Thanks.

    Read the article

< Previous Page | 148 149 150 151 152 153 154 155 156 157 158 159  | Next Page >